]> spindle.queued.net Git - midori/commitdiff
Add missing assignments to fix drag scrolling with KatzeScrolled
authorChristian Dywan <christian@twotoasts.de>
Sat, 30 Jan 2010 22:34:04 +0000 (23:34 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 31 Jan 2010 19:41:30 +0000 (20:41 +0100)
katze/katze-scrolled.c

index 15c52b786242418aad3aceaaaffc938d039dcdbe..87473d3651c5e2dec05021973f4f0df27f4ff359 100644 (file)
@@ -23,8 +23,6 @@
     #define gtk_adjustment_get_upper(adj) adj->upper
     #define gtk_adjustment_get_lower(adj) adj->lower
     #define gtk_adjustment_get_value(adj) adj->value
-    #define gtk_adjustment_get_page_size(adj) adj->page_size
-    #define gtk_adjustment_get_page_size(adj) adj->page_size
 #endif
 
 #define DEFAULT_INTERVAL 50
@@ -331,8 +329,8 @@ adjust_scrollbar (KatzeScrolled* scrolled,
         return FALSE;
     }
 
-    size = ((double)page_size) / (upper - lower) * (horizontal
-        ? widget->allocation.height : widget->allocation.width);
+    size = page_size / (upper - lower)
+        * (horizontal ? widget->allocation.height : widget->allocation.width);
     if (size != *previous_size)
     {
         *previous_size = size;
@@ -580,11 +578,15 @@ do_motion_scroll (KatzeScrolled* scrolled,
         }
 
         hadjustment = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled));
+        hpage_size = gtk_adjustment_get_page_size (hadjustment);
+        hupper = gtk_adjustment_get_upper (hadjustment);
         hvalue = gtk_adjustment_get_value (hadjustment);
         new_hvalue = calculate_motion_scroll_values (hvalue,
             hupper - hpage_size, x, priv->previous_x);
 
         vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled));
+        vpage_size = gtk_adjustment_get_page_size (vadjustment);
+        vupper = gtk_adjustment_get_upper (vadjustment);
         vvalue = gtk_adjustment_get_value (vadjustment);
         new_vvalue = calculate_motion_scroll_values (vvalue,
             vupper - vpage_size, y, priv->previous_y);