From d5544e5dda812244ca63d10188766e2d331632ae Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 11 Mar 2006 11:06:42 +0000 Subject: [PATCH] added back in some x-y positioning code darcs-hash:20060311110642-5007d-e3540dcede9d3376e6d36cee2c110fd81e45ebb7.gz --- src/org/ibex/core/Box.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/org/ibex/core/Box.java b/src/org/ibex/core/Box.java index 396a2b6..b9f71b6 100644 --- a/src/org/ibex/core/Box.java +++ b/src/org/ibex/core/Box.java @@ -173,8 +173,6 @@ public final class Box extends JS.Obj implements Callable, Mesh.Chain { public void constrain(Box b, Affine a) { contentwidth = 0; contentheight = 0; - transform.e = 0; - transform.f = 0; a = a.copy().premultiply(transform); //boolean relevant = packed() || ((fillcolor&0xff000000)!=0x0) || path!=null; @@ -192,10 +190,16 @@ public final class Box extends JS.Obj implements Callable, Mesh.Chain { for(Box child = getChild(0); child != null; child = child.nextSibling()) { xmin = Integer.MAX_VALUE; ymin = Integer.MAX_VALUE; xmax = Integer.MIN_VALUE; ymax = Integer.MIN_VALUE; + if (packed()) { + child.transform.e = 0; + child.transform.f = 0; + } child.constrain(this, Affine.identity()); if (xmin==Integer.MAX_VALUE||xmax==Integer.MIN_VALUE||ymin==Integer.MAX_VALUE||ymax== Integer.MIN_VALUE) continue; - child.transform.e = -1 * xmin; - child.transform.f = -1 * ymin; + if (packed()) { + child.transform.e = -1 * xmin; + child.transform.f = -1 * ymin; + } contentwidth += (xmax-xmin); contentheight = max(ymax-ymin, contentheight); } @@ -401,10 +405,12 @@ public final class Box extends JS.Obj implements Callable, Mesh.Chain { dirty(); polygon = null; } + case "x": transform.e = JSU.toInt(value); + case "y": transform.f = JSU.toInt(value); case "transform": { transform = Affine.parse(JSU.toString(value)); - transform.e = 0; - transform.f = 0; + //transform.e = 0; + //transform.f = 0; if (getSurface() != null) // FIXME getSurface().dirty(0, 0, getSurface().root.contentwidth, getSurface().root.contentheight); REPLACE(); -- 1.7.10.4