diff --git a/examples/tests/rotation.ts b/examples/tests/rotation.ts index c506a4d5..0d7cc2a4 100644 --- a/examples/tests/rotation.ts +++ b/examples/tests/rotation.ts @@ -42,9 +42,6 @@ export default async function ({ renderer, testRoot }: ExampleSettings) { colorBottom: randomColor(), colorTop: randomColor(), parent: testRoot, - shader: renderer.createShader('RoundedRectangle', { - radius: rnd(10, 50), - }), scale: 1, pivot, }); diff --git a/src/core/CoreNode.ts b/src/core/CoreNode.ts index 79585b63..445a8838 100644 --- a/src/core/CoreNode.ts +++ b/src/core/CoreNode.ts @@ -983,6 +983,7 @@ export class CoreNode extends EventEmitter { const mountTranslateY = p.mountY * h; if (p.rotation !== 0 || p.scaleX !== 1 || p.scaleY !== 1) { + const scaleRotate = Matrix3d.rotate(p.rotation).scale(p.scaleX, p.scaleY); const pivotTranslateX = p.pivotX * w; const pivotTranslateY = p.pivotY * h; @@ -991,8 +992,7 @@ export class CoreNode extends EventEmitter { y - mountTranslateY + pivotTranslateY, this.localTransform, ) - .rotate(p.rotation) - .scale(p.scaleX, p.scaleY) + .multiply(scaleRotate) .translate(-pivotTranslateX, -pivotTranslateY); } else { this.localTransform = Matrix3d.translate(