瀏覽代碼

Flow: fix incorrect spacing calculation in auto-width/height

trethaller 2 年之前
父節點
當前提交
90c27d249f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      h2d/Flow.hx

+ 2 - 2
h2d/Flow.hx

@@ -1238,7 +1238,7 @@ class Flow extends Object {
 			}
 
 			forChildren(function(i, p, c) {
-				autoWidth -= horizontalSpacing;
+				if(i > 0) autoWidth -= horizontalSpacing;
 				if(p.autoSize == null) {
 					calcSize(p, c);
 					if(!p.isAbsolute) {
@@ -1401,7 +1401,7 @@ class Flow extends Object {
 			}
 
 			forChildren(function(i, p, c) {
-				autoHeight -= verticalSpacing;
+				if(i > 0) autoHeight -= verticalSpacing;
 				if(p.autoSize == null) {
 					calcSize(p, c);
 					if(!p.isAbsolute) {