Browse code

Stop the animation if I start clicking or dragging the mouse.

From: Marius Gedminas <marius@gedmin.as>

Jose.R.Fonseca authored on 13/07/2008 03:20:51
Showing 1 changed files

  • xdot.py index 40895fc..7af9367 100755
... ...
@@ -713,6 +713,7 @@ class DotWidget(gtk.DrawingArea):
713 713
 
714 714
         self.x, self.y = 0.0, 0.0
715 715
         self.zoom_ratio = 1.0
716
+        self.animation = NoAnimation(self)
716 717
 
717 718
     def set_dotcode(self, dotcode):
718 719
         p = subprocess.Popen(
... ...
@@ -821,6 +822,7 @@ class DotWidget(gtk.DrawingArea):
821 822
             area.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR))
822 823
             self.prevmousex = event.x
823 824
             self.prevmousey = event.y
825
+            self.animation.stop()
824 826
 
825 827
         if event.type not in (gtk.gdk.BUTTON_PRESS, gtk.gdk.BUTTON_RELEASE):
826 828
             return False
... ...
@@ -864,6 +866,7 @@ class DotWidget(gtk.DrawingArea):
864 866
             self.queue_draw()
865 867
             self.prevmousex = x
866 868
             self.prevmousey = y
869
+            self.animation.stop()
867 870
         else:
868 871
             # set cursor
869 872
             if self.get_url(x, y) is not None: