Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-engine
Commits
afa9f983
Commit
afa9f983
authored
May 28, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bfd123e9
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
engine.js
debug/engine.js
+4
-8
engine.js.map
debug/engine.js.map
+1
-1
AlignManager.ts
src/zeroing/decorators/AlignManager.ts
+14
-8
No files found.
debug/engine.js
View file @
afa9f983
...
...
@@ -1915,12 +1915,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if
(
!
that
.
alignEnabled
)
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"
||
that
.
_instanceType
==
"Label"
)
{
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
_a
=
that
.
width
,
tW_Z
=
_a
===
void
0
?
0
:
_a
,
_b
=
that
.
height
,
tH_Z
=
_b
===
void
0
?
0
:
_b
;
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
;
if
(
toBoolean
(
_left
)
&&
toBoolean
(
_right
))
{
...
...
@@ -1968,7 +1964,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
.
_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
;
}
that
.
width
=
maxR
;
...
...
@@ -1981,7 +1977,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
.
_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
;
}
that
.
height
=
maxB
;
...
...
debug/engine.js.map
View file @
afa9f983
This diff is collapsed.
Click to expand it.
src/zeroing/decorators/AlignManager.ts
View file @
afa9f983
...
...
@@ -56,13 +56,15 @@ class AlignManager {
horizonCenter
,
verticalCenter
}
=
that
;
let
{
_width
:
tW_Z
=
0
,
_height
:
tH_Z
=
0
}
=
that
;
if
(
that
.
_instanceType
==
"TextFieldNode"
||
that
.
_instanceType
==
"Label"
)
{
tW_Z
=
that
.
width
;
tH_Z
=
that
.
height
;
}
// 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") {
// 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!!!! 我裂开了
// percentWidth /= 100;
...
...
@@ -179,7 +181,9 @@ 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
.
_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
;
}
that
.
width
=
maxR
;
...
...
@@ -210,7 +214,9 @@ 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
.
_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
;
}
that
.
height
=
maxB
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment