From a6efe6a940c7917cdad977fa1f381ebcaa92ae2d Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 19 Apr 1998 11:16:43 +0000 Subject: [PATCH] Add some geometry debugging assertions and comments. git-svn-id: svn://10.0.0.236/trunk@388 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/xfe/XfeWidgets/Xfe/Geometry.c | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/mozilla/cmd/xfe/XfeWidgets/Xfe/Geometry.c b/mozilla/cmd/xfe/XfeWidgets/Xfe/Geometry.c index 116b1ec737f..c3d4b369818 100644 --- a/mozilla/cmd/xfe/XfeWidgets/Xfe/Geometry.c +++ b/mozilla/cmd/xfe/XfeWidgets/Xfe/Geometry.c @@ -340,15 +340,26 @@ _XfeConfigureWidget(Widget w,int x,int y,int width,int height) printf("_XfeConfigureWidget(%s,%d,%d,%d,%d)\n",XtName(w),x,y,width,height); #endif -#if 0 - assert( x >= 0 ); - assert( y >= 0 ); - - assert( width > 0 ); - assert( height > 0 ); + /* The dimensions could be negative since we use ints. This would + * indicate that the caller is passing in bad dimension values. + * + * These assertions help me find such problems. + */ +#ifdef DEBUG_ramiro + assert( width >= 0 ); + assert( height >= 0 ); #endif - /* Ignore this request if width or height are 0 */ + /* Ignore this request if width or height are 0. + * + * The right thing would be for the above asserts to catch 0 as well. + * + * The problem is that the dynamic nature of manager widgets, sometimes + * causes them to resize their children to be tiny (zero). + * + * Well, its not really a "problem". Ignoring it is seems like a + * reasonable thing to do for now. + */ if (!width || !height) { return;