[banshee/grid] [grid] fix virtual size calculation when no rows/cols



commit 4129a72901c6633c96152555eae7e2f0339f79b0
Author: Aaron Bockover <abockover novell com>
Date:   Thu Jan 21 22:12:57 2010 -0500

    [grid] fix virtual size calculation when no rows/cols

 .../Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
index d445476..52460b8 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
@@ -46,8 +46,8 @@ namespace Hyena.Data.Gui
             // FIXME: this is too simplistic and can result in
             // an extra row of allocation, check the model size
             VirtualSize = new Gdk.Size (
-                ChildSize.Width * Columns,
-                (ChildSize.Height * ModelRowCount) / Rows);
+                ChildSize.Width * Math.Max (Columns, 1),
+                (ChildSize.Height * ModelRowCount) / Math.Max (Rows, 1));
         }
 
         protected override void InvalidateChildCollection ()



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