mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-11 13:59:23 -04:00
Preserve sprite layer order information across saving and loading an sb3.
This commit is contained in:
parent
dc612fb4a1
commit
812e7a3772
7 changed files with 133 additions and 7 deletions
test/unit
|
@ -326,6 +326,23 @@ test('layers', t => { // TODO this tests fake functionality. Move layering tests
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('getLayerOrder returns result of renderer getDrawableOrder or null if renderer is not attached', t => {
|
||||
const s = new Sprite();
|
||||
const r = new Runtime();
|
||||
const a = new RenderedTarget(s, r);
|
||||
|
||||
// getLayerOrder should return null if there is no renderer attached to the runtime
|
||||
t.equal(a.getLayerOrder(), null);
|
||||
|
||||
const renderer = new FakeRenderer();
|
||||
r.attachRenderer(renderer);
|
||||
const b = new RenderedTarget(s, r);
|
||||
|
||||
t.equal(b.getLayerOrder(), 'stub');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('keepInFence', t => {
|
||||
const s = new Sprite();
|
||||
const r = new Runtime();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue