[banshee/1.5.1-fixes: 7/56] [Hyena.Widgets] Fix DivideByZeroException



commit 0938b85ad8ac5c9e237f1b946ddedf87aa62a389
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Oct 15 11:18:08 2009 -0700

    [Hyena.Widgets] Fix DivideByZeroException
    
    AnimatedWidget was sometimes telling its child widget to allocate zero
    width or height.  Fixes LP #452366.

 .../Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs      |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs b/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs
index a56b0e8..5b33fd4 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs
@@ -167,7 +167,10 @@ namespace Hyena.Widgets
                         widget_alloc.Y = allocation.Height - widget_alloc.Height;
                     }
                 }
-                Widget.SizeAllocate (widget_alloc);
+
+                if (widget_alloc.Height > 0 && widget_alloc.Width > 0) {
+                    Widget.SizeAllocate (widget_alloc);
+                }
             }
         }
         
@@ -192,4 +195,4 @@ namespace Hyena.Widgets
 #endregion
         
     }
-}
\ No newline at end of file
+}



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