Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fyge_for_tb
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
王剑峰
fyge_for_tb
Commits
00ec27c1
Commit
00ec27c1
authored
Jul 21, 2021
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.31
parent
be66c9a8
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
10 deletions
+44
-10
fyge.min.js
build/fyge.min.js
+1
-1
fyge.min.js.map
build/fyge.min.js.map
+1
-1
package.json
package.json
+1
-1
record.txt
record.txt
+5
-0
const.ts
src/2d/const.ts
+1
-1
Lottie.ts
src/2d/ui/Lottie.ts
+34
-5
Euler.ts
src/3d/math/Euler.ts
+1
-1
No files found.
build/fyge.min.js
View file @
00ec27c1
This diff is collapsed.
Click to expand it.
build/fyge.min.js.map
View file @
00ec27c1
This diff is collapsed.
Click to expand it.
package.json
View file @
00ec27c1
{
"name"
:
"fyge"
,
"version"
:
"2.0.3
0
"
,
"version"
:
"2.0.3
1
"
,
"description"
:
"canvas渲染引擎"
,
"main"
:
"./build/fyge.min.js"
,
"types"
:
"./build/types.d.ts"
,
...
...
record.txt
View file @
00ec27c1
...
...
@@ -393,6 +393,11 @@
Lottie新增时间轴LottieExpressionTrack,parseExpression函数,runExpressionNode函数
Lottie文件的createLottieTracks方法里把原先分开属性修改成["o", "r", "p", "s"]数组遍历
2.0.31 Lottie新加xy维度分开的情况
Lottie文件里KeyData接口加了s字段
Lottie文件里LottieBaseTrack构造函数参数添加xy,setValue方法里的setValue添加xy参数
Lottie文件里setValue方法添加参数xy,且p和s里处理xy
Lottie文件里createLottieTracks方法遍历s,p,r,o里判断了k是否存在,不存在继续xy分开
大尺寸纹理首次传gpu使用时会掉帧,越大耗时越多。考虑如何处理
...
...
src/2d/const.ts
View file @
00ec27c1
...
...
@@ -7,7 +7,7 @@
* @name VERSION
* @type {string}
*/
export
const
VERSION
=
"2.0.3
0
"
;
export
const
VERSION
=
"2.0.3
1
"
;
/**
...
...
src/2d/ui/Lottie.ts
View file @
00ec27c1
...
...
@@ -157,7 +157,8 @@ interface KsData {
s
:
KeyData
//缩放
}
interface
KeyData
{
a
:
number
,
//貌似没用
a
:
number
,
//貌似没用,0表示无关键帧,1表示有
"s"
:
boolean
,
//true表示区分维度,比如p的x和y分开走
k
:
KeyAniData
[]
|
number
[]
|
number
,
x
:
string
,
//可能有表达式
}
...
...
@@ -226,6 +227,7 @@ class LottieBaseTrack extends HashObject implements IAnimationTrack {
private
times
?:
KeyAniData
[],
private
loop
?:
LoopData
,
private
ip
:
number
=
0
,
//偏移
private
xy
:
"x"
|
"y"
=
null
)
{
super
();
this
.
_instanceType
=
"LottieBaseTrack"
;
...
...
@@ -237,7 +239,7 @@ class LottieBaseTrack extends HashObject implements IAnimationTrack {
setValue
(
time
:
number
)
{
time
-=
this
.
ip
;
// if (!this.obj.visible) return
setValue
(
this
.
obj
,
this
.
cacValue
(
time
),
this
.
type
)
setValue
(
this
.
obj
,
this
.
cacValue
(
time
),
this
.
type
,
this
.
xy
)
// var value = this.cacValue(time);
// switch (this.type) {
// case "r":
...
...
@@ -507,7 +509,7 @@ function getLoopData(x: string): LoopData {
return
{
loopInOrOut
,
type
,
duration
:
rr
}
}
function
setValue
(
obj
:
Sprite
,
value
:
number
|
number
[],
type
:
"r"
|
"o"
|
"s"
|
"p"
)
{
function
setValue
(
obj
:
Sprite
,
value
:
number
|
number
[],
type
:
"r"
|
"o"
|
"s"
|
"p"
,
xy
?:
"x"
|
"y"
)
{
//转下数字的为数组
if
(
typeof
value
==
"number"
)
value
=
[
value
];
switch
(
type
)
{
...
...
@@ -518,10 +520,18 @@ function setValue(obj: Sprite, value: number | number[], type: "r" | "o" | "s" |
obj
.
alpha
=
value
[
0
]
/
100
;
break
;
case
"s"
:
obj
.
scale
.
set
(
value
[
0
]
/
100
,
value
[
1
]
/
100
);
if
(
xy
)
{
obj
[
xy
==
"x"
?
"scaleX"
:
"scaleY"
]
=
value
[
0
]
/
100
;
}
else
{
obj
.
scale
.
set
(
value
[
0
]
/
100
,
value
[
1
]
/
100
);
}
break
;
case
"p"
:
obj
.
position
.
set
(
value
[
0
]
-
obj
.
anchorX
,
value
[
1
]
-
obj
.
anchorY
);
if
(
xy
)
{
obj
[
xy
]
=
value
[
0
]
-
(
xy
==
"x"
?
obj
.
anchorX
:
obj
.
anchorY
);
}
else
{
obj
.
position
.
set
(
value
[
0
]
-
obj
.
anchorX
,
value
[
1
]
-
obj
.
anchorY
);
}
break
;
}
}
...
...
@@ -652,6 +662,25 @@ function createLottieTracks(
[
"o"
,
"r"
,
"p"
,
"s"
].
forEach
((
type
:
"o"
|
"r"
|
"p"
|
"s"
)
=>
{
let
k
:
KeyAniData
[]
|
number
[]
|
number
=
ks
[
type
].
k
;
let
expression
:
string
=
ks
[
type
].
x
;
//考虑x和y分开的情况,不会有加减
if
(
!
k
)
{
//以防万一,判断下r和o
if
(
!
ks
[
type
].
s
||
type
==
"r"
||
type
==
"o"
)
return
;
//这时候x就是维度了,不再是表达式
[
"x"
,
"y"
].
forEach
((
xy
:
"x"
|
"y"
)
=>
{
let
kk
=
ks
[
type
][
xy
].
k
;
let
eexpression
:
string
=
ks
[
type
][
xy
].
x
;
if
(
kk
.
length
)
{
tracks
.
push
(
new
LottieBaseTrack
(
c
as
Sprite
,
type
,
kk
,
getLoopData
(
eexpression
),
offset
,
xy
)
)
}
else
{
setValue
(
c
as
Sprite
,
kk
,
type
,
xy
);
//不管加减表达式
}
})
return
;
}
//@ts-ignore
if
(((
type
==
"o"
||
type
==
"r"
)
&&
k
.
length
)
||
//透明度和旋转,k有长度就是关键帧,
((
type
==
"s"
||
type
==
"p"
)
&&
typeof
k
[
0
]
!=
"number"
))
{
//透明度和旋转,k有长度就是关键帧,位置和缩放得k的元素里不是number
...
...
src/3d/math/Euler.ts
View file @
00ec27c1
...
...
@@ -55,7 +55,7 @@ export class Euler {
this
.
onChangeCallback
();
}
set
(
x
,
y
,
z
,
order
)
{
set
(
x
,
y
,
z
,
order
?
)
{
this
.
_x
=
x
;
this
.
_y
=
y
;
...
...
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