[pdfmod] Fix scrolling the view while dragging



commit fa4cf433bc0f97e79defe9eda3aa5ee6b8693892
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Mar 3 08:52:56 2011 -0600

    Fix scrolling the view while dragging
    
    The view is supposed to scroll when you get get close to the top or
    bottom while dragging.

 src/PdfMod/Gui/DocumentIconView.cs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/PdfMod/Gui/DocumentIconView.cs b/src/PdfMod/Gui/DocumentIconView.cs
index ff08710..a79a7b1 100644
--- a/src/PdfMod/Gui/DocumentIconView.cs
+++ b/src/PdfMod/Gui/DocumentIconView.cs
@@ -212,9 +212,10 @@ namespace PdfMod.Gui
         {
             // Scroll if within 20 pixels of the top or bottom
             var parent = Parent.Parent as Gtk.ScrolledWindow;
-            if (y < 20) {
+            double rel_y = y - parent.Vadjustment.Value;
+            if (rel_y < 20) {
                 parent.Vadjustment.Value -= 30;
-            } else if ((parent.Allocation.Height - y) < 20) {
+            } else if ((parent.Allocation.Height - rel_y) < 20) {
                 parent.Vadjustment.Value = Math.Min (parent.Vadjustment.Upper - parent.Allocation.Height, parent.Vadjustment.Value + 30);
             }
 



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