[gimp] app: Fix a tug of war with scrollbars when middle click panning.



commit d3dde03b78d402d5f826103ebf20e88d49564f17
Author: Alexia Death <alexiadeath gmail com>
Date:   Sat Jan 2 15:23:09 2010 +0200

    app: Fix a tug of war with scrollbars when middle click panning.
    
    Whenever panning with a mouse scrollbars generated reverse events,
    one for each, causing flicker on image borders.

 app/display/gimpdisplayshell-callbacks.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index 60600ba..05003b1 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -1992,20 +1992,28 @@ static void
 gimp_display_shell_vscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll (shell,
-                             0,
-                             gtk_adjustment_get_value (adjustment) -
-                             shell->offset_y);
+  /* If we are panning with mouse, scrollbars are to be ignored
+   * or they will cause jitter in motion
+   */
+  if (! shell->scrolling)
+    gimp_display_shell_scroll (shell,
+                               0,
+                               gtk_adjustment_get_value (adjustment) -
+                               shell->offset_y);
 }
 
 static void
 gimp_display_shell_hscrollbar_update (GtkAdjustment    *adjustment,
                                       GimpDisplayShell *shell)
 {
-  gimp_display_shell_scroll (shell,
-                             gtk_adjustment_get_value (adjustment) -
-                             shell->offset_x,
-                             0);
+  /* If we are panning with mouse, scrollbars are to be ignored
+   * or they will cause jitter in motion 
+   */
+  if (! shell->scrolling)
+    gimp_display_shell_scroll (shell,
+                               gtk_adjustment_get_value (adjustment) -
+                               shell->offset_x,
+                               0);
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]