Commit afa9f983 authored by haiyoucuv's avatar haiyoucuv

1

parent bfd123e9
...@@ -1915,12 +1915,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1915,12 +1915,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (!that.alignEnabled) if (!that.alignEnabled)
return; 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 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; 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" || that._instanceType == "Label") { var _c = (that.parent || {}), _d = _c.width, pW_Z = _d === void 0 ? 0 : _d, _e = _c.height, pH_Z = _e === void 0 ? 0 : _e;
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 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; 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;
if (toBoolean(_left) && toBoolean(_right)) { if (toBoolean(_left) && toBoolean(_right)) {
...@@ -1968,7 +1964,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1968,7 +1964,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (toBoolean(that.children[i].right)) if (toBoolean(that.children[i].right))
continue; continue;
var _x = that.children[i].x || 0; var _x = that.children[i].x || 0;
var _w = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.width : (that.children[i].__width || 0); var _w = that.children[i].width;
(_x + _w > maxR) ? maxR = _x + _w : 0; (_x + _w > maxR) ? maxR = _x + _w : 0;
} }
that.width = maxR; that.width = maxR;
...@@ -1981,7 +1977,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1981,7 +1977,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (toBoolean(that.children[i].bottom)) if (toBoolean(that.children[i].bottom))
continue; continue;
var _y = that.children[i].y || 0; var _y = that.children[i].y || 0;
var _h = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.height : (that.children[i].__height || 0); var _h = that.children[i].height;
(_y + _h > maxB) ? maxB = _y + _h : 0; (_y + _h > maxB) ? maxB = _y + _h : 0;
} }
that.height = maxB; that.height = maxB;
......
This diff is collapsed.
...@@ -56,13 +56,15 @@ class AlignManager { ...@@ -56,13 +56,15 @@ class AlignManager {
horizonCenter, verticalCenter horizonCenter, verticalCenter
} = that; } = that;
let {_width: tW_Z = 0, _height: tH_Z = 0} = that; // let {_width: tW_Z = 0, _height: tH_Z = 0} = that;
if (that._instanceType == "TextFieldNode" || that._instanceType == "Label") { let {width: tW_Z = 0, height: tH_Z = 0} = that;
tW_Z = that.width; // if (that._instanceType == "TextFieldNode" || that._instanceType == "Label") {
tH_Z = that.height; // tW_Z = that.width;
} // tH_Z = that.height;
// }
const {_width: pW_Z = 0, _height: pH_Z = 0} = (that.parent || {}); // const {_width: pW_Z = 0, _height: pH_Z = 0} = (that.parent || {});
const {width: pW_Z = 0, height: pH_Z = 0} = (that.parent || {});
/// TODO null / 100 == 0 ?????? wtf!!!! 我裂开了 /// TODO null / 100 == 0 ?????? wtf!!!! 我裂开了
// percentWidth /= 100; // percentWidth /= 100;
...@@ -179,7 +181,9 @@ class AlignManager { ...@@ -179,7 +181,9 @@ class AlignManager {
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (toBoolean(that.children[i].right)) continue; /// TODO 开启这个,忽略带 right 值的子节点 if (toBoolean(that.children[i].right)) continue; /// TODO 开启这个,忽略带 right 值的子节点
let _x = that.children[i].x || 0; let _x = that.children[i].x || 0;
let _w = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.width : (that.children[i].__width || 0); // let _w = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.width : (that.children[i].__width || 0);
// let _w = that.children[i].__width || 0;
let _w = that.children[i].width;
(_x + _w > maxR) ? maxR = _x + _w : 0; (_x + _w > maxR) ? maxR = _x + _w : 0;
} }
that.width = maxR; that.width = maxR;
...@@ -210,7 +214,9 @@ class AlignManager { ...@@ -210,7 +214,9 @@ class AlignManager {
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (toBoolean(that.children[i].bottom)) continue; /// TODO 开启这个,忽略带 bottom 值的子节点 if (toBoolean(that.children[i].bottom)) continue; /// TODO 开启这个,忽略带 bottom 值的子节点
let _y = that.children[i].y || 0; let _y = that.children[i].y || 0;
let _h = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.height : (that.children[i].__height || 0); // let _h = (that._instanceType == "TextFieldNode" || that._instanceType == "Label") ? that.height : (that.children[i].__height || 0);
// let _h = that.children[i].__height || 0;
let _h = that.children[i].height;
(_y + _h > maxB) ? maxB = _y + _h : 0; (_y + _h > maxB) ? maxB = _y + _h : 0;
} }
that.height = maxB; 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