[pdfmod] Fix bug with scrolling to top on delete/zoom



commit df62c8691c3d0ebbcc885479119a0bfa964b6ba5
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Jul 30 18:22:05 2009 -0700

    Fix bug with scrolling to top on delete/zoom

 src/PdfMod/PdfMod/CellRendererPage.cs |    7 ++++---
 src/PdfMod/PdfMod/PdfIconView.cs      |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/PdfMod/PdfMod/CellRendererPage.cs b/src/PdfMod/PdfMod/CellRendererPage.cs
index 6101059..9b263e9 100644
--- a/src/PdfMod/PdfMod/CellRendererPage.cs
+++ b/src/PdfMod/PdfMod/CellRendererPage.cs
@@ -15,9 +15,11 @@ namespace PdfMod
         const int scale_every = 400;
 
         private ThumbnailLruCache surface_cache;
+        private IconView parent;
 
-        public CellRendererPage ()
+        public CellRendererPage (IconView parent)
         {
+            this.parent = parent;
             surface_cache = new ThumbnailLruCache ();
         }
 
@@ -28,8 +30,7 @@ namespace PdfMod
         {
             base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
             x_offset = y_offset = 0;
-            width = cell_area.Width;
-            height = cell_area.Width;
+            width = height = parent.ItemWidth;
         }
 
         public override void Dispose ()
diff --git a/src/PdfMod/PdfMod/PdfIconView.cs b/src/PdfMod/PdfMod/PdfIconView.cs
index f4acb97..61d45e6 100644
--- a/src/PdfMod/PdfMod/PdfIconView.cs
+++ b/src/PdfMod/PdfMod/PdfIconView.cs
@@ -68,7 +68,7 @@ namespace PdfMod
             Reorderable = false;
             Spacing = 0;
 
-            page_renderer = new CellRendererPage ();
+            page_renderer = new CellRendererPage (this);
             PackStart (page_renderer, true);
             AddAttribute (page_renderer, "page", PdfListStore.PageColumn);
 



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