Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
svge-egret
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
王剑峰
svge-egret
Commits
f0ca8420
Commit
f0ca8420
authored
Oct 28, 2019
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
86196e48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
15 deletions
+28
-15
svga.egret.min.js
build/svga.egret.min.js
+1
-1
MovieClip.js
src/Egret/MovieClip.js
+27
-14
No files found.
build/svga.egret.min.js
View file @
f0ca8420
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/Egret/MovieClip.js
View file @
f0ca8420
...
@@ -165,11 +165,7 @@ export class MovieClip extends egret.DisplayObjectContainer {
...
@@ -165,11 +165,7 @@ export class MovieClip extends egret.DisplayObjectContainer {
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
this
[
ele
.
imageKey
]
=
child
;
this
[
ele
.
imageKey
]
=
child
;
//透明度处理
//透明度处理
if
(
ele
.
frames
[
0
].
alpha
<
0.05
)
{
child
.
alpha
=
ele
.
frames
[
0
].
alpha
;
child
.
visible
=
false
;
}
else
{
child
.
alpha
=
ele
.
frames
[
0
].
alpha
;
}
child
[
"frames"
]
=
ele
.
frames
;
child
[
"frames"
]
=
ele
.
frames
;
var
transform
=
ele
.
frames
[
0
].
transform
var
transform
=
ele
.
frames
[
0
].
transform
child
.
matrix
=
new
egret
.
Matrix
().
copyFrom
(
transform
);
child
.
matrix
=
new
egret
.
Matrix
().
copyFrom
(
transform
);
...
@@ -461,15 +457,10 @@ export class MovieClip extends egret.DisplayObjectContainer {
...
@@ -461,15 +457,10 @@ export class MovieClip extends egret.DisplayObjectContainer {
if
(
child
[
"frames"
]
&&
child
[
"frames"
][
s
.
_curFrame
-
1
])
{
if
(
child
[
"frames"
]
&&
child
[
"frames"
][
s
.
_curFrame
-
1
])
{
var
frame
=
child
[
"frames"
][
s
.
_curFrame
-
1
];
var
frame
=
child
[
"frames"
][
s
.
_curFrame
-
1
];
//layout不晓得干嘛用,暂不管
//layout不晓得干嘛用,暂不管
if
(
frame
.
alpha
<
0.05
)
{
child
.
alpha
=
frame
.
alpha
;
child
.
visible
=
false
;
//先判断transform是否相等
}
else
{
if
(
!
child
.
matrix
.
equals
(
frame
.
transform
))
{
child
.
visible
=
true
;
child
.
matrix
=
new
egret
.
Matrix
().
copyFrom
(
frame
.
transform
);
child
.
alpha
=
frame
.
alpha
;
//先判断transform是否相等
if
(
!
child
.
matrix
.
equals
(
frame
.
transform
))
{
child
.
matrix
=
new
egret
.
Matrix
().
copyFrom
(
frame
.
transform
);
}
}
}
}
}
}
}
...
@@ -556,4 +547,26 @@ function getAsset(source, compFunc, thisObject) {
...
@@ -556,4 +547,26 @@ function getAsset(source, compFunc, thisObject) {
else
{
else
{
RES
.
getResByUrl
(
source
,
compFunc
,
thisObject
,
RES
.
ResourceItem
.
TYPE_IMAGE
);
RES
.
getResByUrl
(
source
,
compFunc
,
thisObject
,
RES
.
ResourceItem
.
TYPE_IMAGE
);
}
}
}
function
deepCopyFrames
(
frames
,
tx
,
ty
,
scaleX
=
1
,
scaleY
=
1
)
{
var
cf
=
[];
for
(
var
j
=
0
;
j
<
frames
.
length
;
j
++
)
{
var
frame
=
frames
[
j
];
const
pt
=
frame
.
transform
;
var
f
=
{
alpha
:
0
,
transform
:
null
};
//透明度
f
.
alpha
=
frame
.
alpha
;
f
.
transform
=
{
a
:
scaleX
*
pt
.
a
,
b
:
scaleX
*
pt
.
b
,
c
:
scaleY
*
pt
.
c
,
d
:
scaleY
*
pt
.
d
,
tx
:
(
tx
*
pt
.
a
)
+
(
ty
*
pt
.
c
)
+
pt
.
tx
,
ty
:
(
tx
*
pt
.
b
)
+
(
ty
*
pt
.
d
)
+
pt
.
ty
,
};
cf
.
push
(
f
)
}
return
cf
;
}
}
\ No newline at end of file
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