mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-08-21 10:49:16 -04:00
Revert "Revert "Revert "Skin alter push"""
This commit is contained in:
parent
928cd60dd5
commit
1cd9e54834
8 changed files with 46 additions and 124 deletions
test/unit
|
@ -8,7 +8,6 @@ global.document = {
|
|||
|
||||
const Drawable = require('../../src/Drawable');
|
||||
const MockSkin = require('../fixtures/MockSkin');
|
||||
const MockSkinPool = require('../fixtures/MockSkinPool');
|
||||
const Rectangle = require('../../src/Rectangle');
|
||||
|
||||
/**
|
||||
|
@ -32,7 +31,6 @@ test('translate by position', t => {
|
|||
const drawable = new Drawable();
|
||||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [200, 50];
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
expected.initFromBounds(0, 200, -50, 0);
|
||||
t.same(snapToNearest(drawable.getAABB()), expected);
|
||||
|
@ -49,7 +47,6 @@ test('translate by costume center', t => {
|
|||
const drawable = new Drawable();
|
||||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [200, 50];
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
drawable.skin.setRotationCenter(1, 0);
|
||||
expected.initFromBounds(-1, 199, -50, 0);
|
||||
|
@ -67,7 +64,6 @@ test('translate and rotate', t => {
|
|||
const drawable = new Drawable();
|
||||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [200, 50];
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
drawable.updateProperties({position: [1, 2], direction: 0});
|
||||
expected.initFromBounds(1, 51, 2, 202);
|
||||
|
@ -94,7 +90,6 @@ test('rotate by non-right-angles', t => {
|
|||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [10, 10];
|
||||
drawable.skin.setRotationCenter(5, 5);
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
expected.initFromBounds(-5, 5, -5, 5);
|
||||
t.same(snapToNearest(drawable.getAABB()), expected);
|
||||
|
@ -111,7 +106,6 @@ test('scale', t => {
|
|||
const drawable = new Drawable();
|
||||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [200, 50];
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
drawable.updateProperties({scale: [100, 50]});
|
||||
expected.initFromBounds(0, 200, -25, 0);
|
||||
|
@ -134,7 +128,6 @@ test('rotate and scale', t => {
|
|||
const drawable = new Drawable();
|
||||
drawable.skin = new MockSkin();
|
||||
drawable.skin.size = [100, 1000];
|
||||
MockSkinPool.forDrawableSkin(drawable);
|
||||
|
||||
drawable.skin.setRotationCenter(50, 50);
|
||||
expected.initFromBounds(-50, 50, -950, 50);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue