0.8.6: clip instances get stage transforms (x/y/scale/rotation)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
53c0410824
commit
d60684edd1
7 files changed
+512
-41
No files matched your search
+13
-1
@@ -1,6 +1,6 @@
|
||||
import type { Scene } from '@/types/scene'
|
||||
|
||||
const RUNTIME_VERSION = '15'
|
||||
const RUNTIME_VERSION = '17'
|
||||
|
||||
const ENGINE_SOURCE = `(function(){
|
||||
if (window.AnimatrPlayer && window.AnimatrPlayer.__v === '${RUNTIME_VERSION}') return;
|
||||
@@ -732,9 +732,21 @@ const ENGINE_SOURCE = `(function(){
|
||||
var offset=time-inst2.startTime;
|
||||
if(offset<0||offset>visibleClip)continue;
|
||||
var localT=tS+offset;
|
||||
var ix2=inst2.x||0, iy2=inst2.y||0;
|
||||
var isx2=(inst2.scaleX==null?1:inst2.scaleX);
|
||||
var isy2=(inst2.scaleY==null?1:inst2.scaleY);
|
||||
var irot2=inst2.rotation||0;
|
||||
var needsXf=ix2!==0||iy2!==0||isx2!==1||isy2!==1||irot2!==0;
|
||||
if(needsXf){
|
||||
ctx.save();
|
||||
ctx.translate(ix2,iy2);
|
||||
if(irot2!==0) ctx.rotate(irot2*Math.PI/180);
|
||||
ctx.scale(isx2,isy2);
|
||||
}
|
||||
for(var cl2=clip2.layers.length-1;cl2>=0;cl2--){
|
||||
drawLayer(clip2.layers[cl2],localT);
|
||||
}
|
||||
if(needsXf) ctx.restore();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user