Procházet zdrojové kódy

allow absolute layout component

ncannasse před 12 roky
rodič
revize
e684d01886
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  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;