From 57d1221cd31150e403db66f796d3f7470e552012 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 8 Sep 2006 02:11:46 +0200 Subject: [PATCH] Ensure w/h > 0 --- sugar/canvas/GridLayout.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sugar/canvas/GridLayout.py b/sugar/canvas/GridLayout.py index 588eb066..6484d3d3 100644 --- a/sugar/canvas/GridLayout.py +++ b/sugar/canvas/GridLayout.py @@ -37,6 +37,9 @@ class GridLayout: width = constraints.width * w / self._cols - padding * 2 height = constraints.height * h / self._rows + padding * 2 + width = max(0, width) + height = max(0, height) + return [x, y, width, height] def layout_canvas_group(self, group):