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
06342599
Commit
06342599
authored
May 28, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f277d24c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
+17
-13
workspace.xml
.idea/workspace.xml
+1
-4
engine.js
debug/engine.js
+6
-2
engine.js.map
debug/engine.js.map
+1
-1
AlignManager.ts
src/zeroing/decorators/AlignManager.ts
+9
-6
No files found.
.idea/workspace.xml
View file @
06342599
...
...
@@ -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$"
/>
...
...
debug/engine.js
View file @
06342599
...
...
@@ -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
;
...
...
debug/engine.js.map
View file @
06342599
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/zeroing/decorators/AlignManager.ts
View file @
06342599
...
...
@@ -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
;
...
...
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