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



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

    fix virtual size calculation when no rows/cols

 src/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs b/src/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
index d445476..52460b8 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/DataViewLayoutGrid.cs
+++ b/src/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]