Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-components
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
劳工
scilla-components
Commits
c226d8b1
Commit
c226d8b1
authored
Apr 18, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改tween
parent
7dbeb2b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
BounceZoom.ts
src/animation/BounceZoom.ts
+1
-1
TouchZoom.ts
src/animation/TouchZoom.ts
+2
-2
ScrollView.ts
src/ui/ScrollView.ts
+1
-1
No files found.
src/animation/BounceZoom.ts
View file @
c226d8b1
...
...
@@ -19,7 +19,7 @@ export default class BounceZoom extends ScillaComponent {
super
.
onAwake
();
this
.
_tween
=
createTween
(
this
,
this
.
transform
,
false
,
{
clazz
:
Vector2D
,
fields
:
[
'x'
,
'y'
],
autoPlay
:
false
}
{
fields
:
[
'x'
,
'y'
],
autoPlay
:
false
}
)
.
to
({
scale
:
this
.
targetScale
.
clone
()},
this
.
duration
*
0.5
)
.
to
({
scale
:
originScale
.
clone
()},
this
.
duration
*
0.5
)
...
...
src/animation/TouchZoom.ts
View file @
c226d8b1
...
...
@@ -27,10 +27,10 @@ export default class TouchZoom extends InteractComponent {
const
scaleFrom
=
transform
.
scale
.
clone
();
const
scaleTo
=
transform
.
scale
.
clone
().
add
(
scaleOffset
);
this
.
_zoomIn
=
createTween
(
this
,
transform
,
false
,
{
autoPlay
:
false
,
clazz
:
Vector2D
,
fields
:
[
'x'
,
'y'
]})
this
.
_zoomIn
=
createTween
(
this
,
transform
,
false
,
{
autoPlay
:
false
,
fields
:
[
'x'
,
'y'
]})
.
to
({
scale
:
scaleTo
},
duration
,
easeFunc
);
this
.
_zoomOut
=
createTween
(
this
,
transform
,
false
,
{
autoPlay
:
false
,
clazz
:
Vector2D
,
fields
:
[
'x'
,
'y'
]})
this
.
_zoomOut
=
createTween
(
this
,
transform
,
false
,
{
autoPlay
:
false
,
fields
:
[
'x'
,
'y'
]})
.
to
({
scale
:
scaleFrom
},
duration
,
easeFunc
);
}
}
...
...
src/ui/ScrollView.ts
View file @
c226d8b1
...
...
@@ -132,7 +132,7 @@ export default class ScrollView extends InteractComponent {
const
targetPos
=
createVector2D
(
tx
,
ty
);
const
duration
=
Math
.
min
(
500
,
Math
.
max
(
targetPos
.
distance
(
position
),
200
));
createTween
(
this
,
this
.
_contentTransform
,
true
,
{
clazz
:
Vector2D
,
fields
:
[
'x'
,
'y'
]})
createTween
(
this
,
this
.
_contentTransform
,
true
,
{
fields
:
[
'x'
,
'y'
]})
.
to
({
position
:
targetPos
},
duration
,
ease
.
cubicOut
);
}
}
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