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
c1a8fe24
Commit
c1a8fe24
authored
Aug 17, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
20a02e96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
ScrollViewBase.ts
src/2d/ui/ScrollViewBase.ts
+12
-3
AlignManager.ts
src/zeroing/decorators/AlignManager.ts
+3
-2
No files found.
src/2d/ui/ScrollViewBase.ts
View file @
c1a8fe24
...
...
@@ -3,6 +3,8 @@ import Graphics from "../graphics/Graphics";
import
{
MouseEvent
}
from
"../events/MouseEvent"
;
import
{
Event
}
from
"../events/Event"
;
import
{
SCROLL_DIRECTION
}
from
"../const"
;
import
{
Tween
}
from
"../tween/Tween"
;
import
{
Ease
}
from
"../tween/Ease"
;
// import Tween from "../../tweenSimple/Tween";
...
...
@@ -231,7 +233,7 @@ export class ScrollViewBase extends Container {
tarP = s.distance - s.maxDistance;
}
}*/
if
(
view
[
s
.
paramXY
]
<
s
.
distance
-
s
.
maxDistance
)
{
if
(
view
[
s
.
paramXY
]
<
s
.
distance
-
s
.
maxDistance
)
{
if
(
s
.
distance
<
s
.
maxDistance
)
{
tarP
=
s
.
distance
-
s
.
maxDistance
;
}
...
...
@@ -270,7 +272,7 @@ export class ScrollViewBase extends Container {
return
this
.
calMaxDistance
();
}
protected
calMaxDistance
(){
protected
calMaxDistance
()
{
return
this
.
viewPort
[
this
.
paramSize
]
+
this
.
viewPort
.
getLocalBounds
()[
this
.
paramXY
]
}
...
...
@@ -418,9 +420,16 @@ export class ScrollViewBase extends Container {
// if (s.speed == 0) {
// s.dispatchEvent(Event.ON_SCROLL_START);
// }
s
.
isStop
=
true
;
s
.
isMouseDownState
=
0
;
s
.
viewPort
[
s
.
paramXY
]
=
-
dis
;
if
(
time
>
0
){
Tween
.
get
(
s
.
viewPort
,
null
,
null
,
true
)
.
to
({[
s
.
paramXY
]:
-
dis
},
time
,
Ease
.
cubicInOut
);
}
else
{
s
.
viewPort
[
s
.
paramXY
]
=
-
dis
;
}
}
}
...
...
src/zeroing/decorators/AlignManager.ts
View file @
c1a8fe24
...
...
@@ -23,7 +23,7 @@ class AlignManager {
const
list
=
this
.
alignList
;
list
.
forEach
((
v
:
Container
)
=>
{
if
(
v
.
destroyed
)
{
if
(
v
.
destroyed
)
{
return
;
}
this
.
autoSize
(
v
);
// 去调整大小
...
...
@@ -32,12 +32,13 @@ class AlignManager {
// 要在这里单独检查,因为对齐一次后可能遇到其父节点需要对齐导致其再对齐一次
list
.
forEach
((
v
)
=>
{
if
(
v
.
destroyed
)
{
if
(
v
.
destroyed
)
{
return
;
}
if
(
v
.
alignMode
===
ALIGN_MODE
.
ONCE
)
{
// 如果是单次对齐则一次运算之后就关闭它
v
.
alignEnabled
=
false
;
}
v
.
onLayoutComplete
&&
v
.
onLayoutComplete
();
});
// 干掉列表
list
.
length
=
0
;
...
...
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