浏览代码

flow stack mode rounds children positions

trethaller 6 年之前
父节点
当前提交
3888b14fae
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      h2d/Flow.hx

+ 3 - 3
h2d/Flow.hx

@@ -226,7 +226,7 @@ class Flow extends Object {
 		if(layout == v)
 			return v;
 		needReflow = true;
-		return layout = v;
+		return layout = v == null ? Horizontal : v;
 	}
 
 	function get_isVertical() {
@@ -943,7 +943,7 @@ class Flow extends Object {
 				case Right:
 					xmax - p.calculatedWidth;
 				case Middle:
-					xmin + ((xmax - xmin) - p.calculatedWidth) * 0.5;
+					xmin + Std.int(((xmax - xmin) - p.calculatedWidth) * 0.5);
 				default:
 					xmin;
 				}
@@ -952,7 +952,7 @@ class Flow extends Object {
 				case Bottom:
 					ymax - p.calculatedHeight;
 				case Middle:
-					ymin + ((ymax - ymin) - p.calculatedHeight) * 0.5;
+					ymin + Std.int(((ymax - ymin) - p.calculatedHeight) * 0.5);
 				default:
 					ymin;
 				}