summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Drawer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Drawer.cpp b/Drawer.cpp
index d2d50bb..57c92c6 100644
--- a/Drawer.cpp
+++ b/Drawer.cpp
@@ -135,7 +135,7 @@ void Drawer::updateScrollbars(float x, float y) {
if(pageSize > (upper-lower) && width < imageWidth)
value = 0;
else
- value = gtk_adjustment_get_value(hAdjustment) + (x-0.5)*pageSize*(pageSize/width-1);
+ value = gtk_adjustment_get_value(hAdjustment) + (x-0.5)*(pageSize-width);
gtk_adjustment_set_value(hAdjustment, MAX(MIN(value, maxX - width/2), minX + width/2));
g_object_get(G_OBJECT(vAdjustment), "lower", &lower, "upper", &upper, "page_size", &pageSize, NULL);
@@ -145,7 +145,7 @@ void Drawer::updateScrollbars(float x, float y) {
if(pageSize > (upper-lower) && height < imageHeight)
value = 0;
else
- value = gtk_adjustment_get_value(vAdjustment) + (y-0.5)*pageSize*(pageSize/height-1);
+ value = gtk_adjustment_get_value(vAdjustment) + (y-0.5)*(pageSize-height);
gtk_adjustment_set_value(vAdjustment, MAX(MIN(value, maxY - height/2), minY + height/2));
gdk_window_thaw_updates(drawingArea->window);