Commit 06342599 authored by haiyoucuv's avatar haiyoucuv

1

parent f277d24c
......@@ -3,9 +3,6 @@
<component name="ChangeListManager">
<list default="true" id="af35c04f-08f6-48ed-85db-2f94c60e87fd" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/debug/engine.js" beforeDir="false" afterPath="$PROJECT_DIR$/debug/engine.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/debug/engine.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/debug/engine.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/2d/display/Container.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/2d/display/Container.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/decorators/AlignManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/decorators/AlignManager.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/decorators/auto-adjust.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/decorators/auto-adjust.ts" afterDir="false" />
</list>
......@@ -26,7 +23,7 @@
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="res-group" />
<entry key="$PROJECT_DIR$" value="auto_align_qx" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
......
......@@ -1952,6 +1952,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return;
var percentWidth = that.percentWidth, percentHeight = that.percentHeight, top = that.top, bottom = that.bottom, left = that.left, right = that.right, percentTop = that.percentTop, percentBottom = that.percentBottom, percentLeft = that.percentLeft, percentRight = that.percentRight, horizonCenter = that.horizonCenter, verticalCenter = that.verticalCenter;
var _a = that._width, tW_Z = _a === void 0 ? 0 : _a, _b = that._height, tH_Z = _b === void 0 ? 0 : _b;
if (that._instanceType == "TextFieldNode") {
tW_Z = that.width;
tH_Z = that.height;
}
var _c = (that.parent || {}), _d = _c._width, pW_Z = _d === void 0 ? 0 : _d, _e = _c._height, pH_Z = _e === void 0 ? 0 : _e;
var judgePL = toBoolean(percentLeft), judgePR = toBoolean(percentRight), judgePT = toBoolean(percentTop), judgePB = toBoolean(percentBottom);
var _left = judgePL ? percentLeft / 100 * pW_Z : left, _right = judgePR ? percentRight / 100 * pW_Z : right, _top = judgePT ? percentTop / 100 * pH_Z : top, _bottom = judgePB ? percentBottom / 100 * pH_Z : bottom;
......@@ -2000,7 +2004,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (toBoolean(that.children[i].right))
continue;
var _x = that.children[i].x || 0;
var _w = that.children[i].__width || 0;
var _w = (that._instanceType == "TextFieldNode") ? that.width : (that.children[i].__width || 0);
(_x + _w > maxR) ? maxR = _x + _w : 0;
}
that.width = maxR;
......@@ -2013,7 +2017,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (toBoolean(that.children[i].bottom))
continue;
var _y = that.children[i].y || 0;
var _h = that.children[i].__height || 0;
var _h = (that._instanceType == "TextFieldNode") ? that.height : (that.children[i].__height || 0);
(_y + _h > maxB) ? maxB = _y + _h : 0;
}
that.height = maxB;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -57,7 +57,10 @@ class AlignManager {
} = that;
let {_width: tW_Z = 0, _height: tH_Z = 0} = that;
if (that._instanceType == "TextFieldNode") {
tW_Z = that.width;
tH_Z = that.height;
}
const {_width: pW_Z = 0, _height: pH_Z = 0} = (that.parent || {});
/// TODO null / 100 == 0 ?????? wtf!!!! 我裂开了
......@@ -137,8 +140,8 @@ class AlignManager {
}
}
that.children&&that.children.forEach(v => this.align(v));
that.children && that.children.forEach(v => this.align(v));
}
/**
......@@ -147,7 +150,7 @@ class AlignManager {
*/
private autoSize(that) {
const len = that.children?that.children.length:0
const len = that.children ? that.children.length : 0
if (len > 0) {
// 检测本身的是否是可以自动宽
......@@ -176,7 +179,7 @@ class AlignManager {
for (let i = 0; i < len; i++) {
if (toBoolean(that.children[i].right)) continue; /// TODO 开启这个,忽略带 right 值的子节点
let _x = that.children[i].x || 0;
let _w = that.children[i].__width || 0;
let _w = (that._instanceType == "TextFieldNode") ? that.width : (that.children[i].__width || 0);
(_x + _w > maxR) ? maxR = _x + _w : 0;
}
that.width = maxR;
......@@ -207,7 +210,7 @@ class AlignManager {
for (let i = 0; i < len; i++) {
if (toBoolean(that.children[i].bottom)) continue; /// TODO 开启这个,忽略带 bottom 值的子节点
let _y = that.children[i].y || 0;
let _h = that.children[i].__height || 0;
let _h = (that._instanceType == "TextFieldNode") ? that.height : (that.children[i].__height || 0);
(_y + _h > maxB) ? maxB = _y + _h : 0;
}
that.height = maxB;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment