mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Change order of rotation
This commit is contained in:
parent
eeca597a0f
commit
63924bceee
@ -1056,17 +1056,19 @@ export class Transformer extends Group {
|
|||||||
oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);
|
oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);
|
||||||
|
|
||||||
const newTr = new Transform();
|
const newTr = new Transform();
|
||||||
newTr.rotate(newAttrs.rotation);
|
|
||||||
const newScaleX = newAttrs.width / baseSize;
|
const newScaleX = newAttrs.width / baseSize;
|
||||||
const newScaleY = newAttrs.height / baseSize;
|
const newScaleY = newAttrs.height / baseSize;
|
||||||
|
|
||||||
if (this.flipEnabled() === false) {
|
if (this.flipEnabled() === false) {
|
||||||
newTr.translate(
|
newTr.translate(
|
||||||
newAttrs.x + (newAttrs.width < 0 ? newAttrs.width : 0),
|
newAttrs.x + (newAttrs.width < 0 ? newAttrs.width : 0),
|
||||||
newAttrs.y + (newAttrs.height < 0 ? newAttrs.height : 0)
|
newAttrs.y + (newAttrs.height < 0 ? newAttrs.height : 0)
|
||||||
);
|
);
|
||||||
|
newTr.rotate(newAttrs.rotation);
|
||||||
newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));
|
newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));
|
||||||
} else {
|
} else {
|
||||||
newTr.translate(newAttrs.x, newAttrs.y);
|
newTr.translate(newAttrs.x, newAttrs.y);
|
||||||
|
newTr.rotate(newAttrs.rotation);
|
||||||
newTr.scale(newScaleX, newScaleY);
|
newTr.scale(newScaleX, newScaleY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user