瀏覽代碼

calculate a second time correct size when autosize not aligned with direction

Nicolas Cannasse 2 月之前
父節點
當前提交
f647f98404
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      h2d/Flow.hx

+ 2 - 2
h2d/Flow.hx

@@ -1412,7 +1412,7 @@ class Flow extends Object {
 
 
 			// position all not absolute nodes
 			// position all not absolute nodes
 			forChildren(function(i, p, c) {
 			forChildren(function(i, p, c) {
-				if( p.autoSizeWidth != null )
+				if( p.autoSizeWidth != null || p.autoSizeHeight != null )
 					calcSize(p, c);
 					calcSize(p, c);
 				var br = false;
 				var br = false;
 				if( ((multiline && x - startX + p.calculatedWidth > maxInWidth) || p.lineBreak) && x - startX > 0 ) {
 				if( ((multiline && x - startX + p.calculatedWidth > maxInWidth) || p.lineBreak) && x - startX > 0 ) {
@@ -1610,7 +1610,7 @@ class Flow extends Object {
 
 
 			// position all not absolute nodes
 			// position all not absolute nodes
 			forChildren(function(i, p, c) {
 			forChildren(function(i, p, c) {
-				if( p.autoSizeHeight != null )
+				if( p.autoSizeWidth != null || p.autoSizeHeight != null )
 					calcSize(p, c);
 					calcSize(p, c);
 				var br = false;
 				var br = false;
 				if( ((multiline && y - startY + p.calculatedHeight > maxInHeight) || p.lineBreak) && y - startY > 0 ) {
 				if( ((multiline && y - startY + p.calculatedHeight > maxInHeight) || p.lineBreak) && y - startY > 0 ) {