From f0c0afaff382c85c2434fe7c7420fbfd3904c0a3 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:39:01 +0000 Subject: [PATCH] 2003/10/09 07:59:35 darcs-hash:20040130073901-2ba56-2752ff9d1cfa520fcb191850fdcb2c97d93ac692.gz --- src/org/xwt/Box.java.pp | 57 ++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) diff --git a/src/org/xwt/Box.java.pp b/src/org/xwt/Box.java.pp index 09035f9..5c7a242 100644 --- a/src/org/xwt/Box.java.pp +++ b/src/org/xwt/Box.java.pp @@ -107,8 +107,6 @@ public final class Box extends JS.Scope { public LENGTH minheight = 0; public LENGTH maxwidth = MAX_LENGTH; public LENGTH maxheight = MAX_LENGTH; - private LENGTH hpad = 0; - private LENGTH vpad = 0; private String text = null; private Res font = null; private int fontsize = 10; @@ -128,7 +126,7 @@ public final class Box extends JS.Scope { public LENGTH height = 0; private int row = 0; // FEATURE use a short private int col = 0; // FEATURE use a short - private LENGTH contentwidth = 0; // == max(minwidth, textwidth+pad, sum(child.contentwidth) + pad) + private LENGTH contentwidth = 0; // == max(minwidth, textwidth, sum(child.contentwidth)) private LENGTH contentheight = 0; private LENGTH offset_x = 0; private LENGTH offset_y = 0; @@ -200,7 +198,7 @@ public final class Box extends JS.Scope { if (isinside && cursor != null) getRoot().cursor = cursor; // if the mouse has moved into our padding region, it is considered 'outside' all our children - if (!(mousex >= hpad && mousey >= vpad && mousex < width - hpad && mousey < height + vpad)) forceleave = true; + if (!(mousex >= 0 && mousey >= 0 && mousex < width && mousey < height)) forceleave = true; for(Box b = getChild(numChildren() - 1); b != null; b = b.prevSibling()) { b.Move(oldmousex - b.x, oldmousey - b.y, mousex - b.x, mousey - b.y, forceleave); @@ -266,8 +264,7 @@ public final class Box extends JS.Scope { // --- Phase 2 ---------------------------------------------------------------------- // compute the min/max sizes of the columns and rows and set our contentwidth if (numChildren() != 0) { - //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight numCols/numRows hpad/vpad - contentwidth = 2 * hpad; + //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight numCols/numRows int numCols = cols; if (numCols == 0) for(Box child = getChild(0); child != null; child = child.nextSibling()) @@ -277,7 +274,7 @@ public final class Box extends JS.Scope { if (!(((child.flags & NOTPACKED_FLAG) != 0) || ((child.flags & INVISIBLE_FLAG) != 0))) colWidth[child.col] = max(colWidth[child.col], child.contentwidth / child.colspan); for(int col=0; col 0) while(slack > 0) { @@ -396,14 +393,14 @@ public final class Box extends JS.Scope { if ((child.flags & NOTPACKED_FLAG) != 0) { child_x = child.x; child_y = child.y; - child_width = ((child.flags & HSHRINK_FLAG) != 0) ? child.contentwidth : min(child.maxwidth, width - child.x - hpad); - child_height = ((child.flags & VSHRINK_FLAG) != 0) ? child.contentheight : min(child.maxheight, height - child.y - vpad); + child_width = ((child.flags & HSHRINK_FLAG) != 0) ? child.contentwidth : min(child.maxwidth, width - child.x); + child_height = ((child.flags & VSHRINK_FLAG) != 0) ? child.contentheight : min(child.maxheight, height - child.y); } else { int diff; - //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight HSHRINK_FLAG/VSHRINK_FLAG marginWidth/marginHeight hpad/vpad child_x/child_y child_width/child_height + //#repeat x/y y/x width/height col/row cols/rows colspan/rowspan colWidth/rowHeight maxwidth/maxheight minwidth/minheight contentwidth/contentheight colMaxWidth/rowMaxHeight HSHRINK_FLAG/VSHRINK_FLAG marginWidth/marginHeight child_x/child_y child_width/child_height child_width = 0; for(int i=child.col; i