瀏覽代碼

allow absolute layout component

ncannasse 12 年之前
父節點
當前提交
e684d01886
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      h2d/comp/Component.hx

+ 7 - 2
h2d/comp/Component.hx

@@ -198,8 +198,13 @@ class Component extends Sprite {
 		} else {
 			var oldx = ctx.xPos;
 			var oldy = ctx.yPos;
-			ctx.xPos = 0;
-			ctx.yPos = 0;
+			if( style.layout == Absolute ) {
+				ctx.xPos = null;
+				ctx.yPos = null;
+			} else {
+				ctx.xPos = 0;
+				ctx.yPos = 0;
+			}
 			for( c in components )
 				c.resizeRec(ctx);
 			ctx.xPos = oldx;