Commit 6324cf44 authored by wjf's avatar wjf

l

parent f0ca8420
......@@ -550,8 +550,25 @@ function getAsset(source, compFunc, thisObject) {
}
function deepCopyFrames(frames, tx, ty, scaleX = 1, scaleY = 1) {
function deepCopyFrames(
frames,
x,
y,
scaleX = 1,
scaleY = 1,
rotation = 0,
anchorX = 0,
anchorY = 0
) {
var cf = [];
rotation *= Math.PI / 180;
var lt = {};
lt.a = Math.cos(rotation) * scaleX;
lt.b = Math.sin(rotation) * scaleX;
lt.c = -Math.sin(rotation) * scaleY;
lt.d = Math.cos(rotation) * scaleY;
lt.tx = x + anchorX - ((anchorX * lt.a) + (anchorY * lt.c));
lt.ty = y + anchorY - ((anchorX * lt.b) + (anchorY * lt.d));
for (var j = 0; j < frames.length; j++) {
var frame = frames[j];
const pt = frame.transform;
......@@ -559,12 +576,12 @@ function deepCopyFrames(frames, tx, ty, scaleX = 1, scaleY = 1) {
//透明度
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,
a: (lt.a * pt.a) + (lt.b * pt.c),
b: (lt.a * pt.b) + (lt.b * pt.d),
c: (lt.c * pt.a) + (lt.d * pt.c),
d: (lt.c * pt.b) + (lt.d * pt.d),
tx: (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx,
ty: (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty,
};
cf.push(f)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment