mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Fix autodrawing for Konva.Transformer
when it is on a different layer
This commit is contained in:
parent
0e2a09ba46
commit
184322e2a9
@ -3,6 +3,7 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
* Fix autodrawing for `Konva.Transformer` when it is on a different layer
|
||||||
* Fix `Konva.RegularPolygon` size calculations.
|
* Fix `Konva.RegularPolygon` size calculations.
|
||||||
|
|
||||||
## 7.1.8
|
## 7.1.8
|
||||||
|
@ -1003,7 +1003,7 @@ export class Transformer extends Group {
|
|||||||
newTr.rotate(newAttrs.rotation);
|
newTr.rotate(newAttrs.rotation);
|
||||||
newTr.scale(newAttrs.width / baseSize, newAttrs.height / baseSize);
|
newTr.scale(newAttrs.width / baseSize, newAttrs.height / baseSize);
|
||||||
|
|
||||||
// now lets think we had [old transform] and now we have [new transform]
|
// now lets think we had [old transform] and n ow we have [new transform]
|
||||||
// Now, the questions is: how can we transform "parent" to go from [old transform] into [new transform]
|
// Now, the questions is: how can we transform "parent" to go from [old transform] into [new transform]
|
||||||
// in equation it will be:
|
// in equation it will be:
|
||||||
// [delta transform] * [old transform] = [new transform]
|
// [delta transform] * [old transform] = [new transform]
|
||||||
@ -1033,6 +1033,7 @@ export class Transformer extends Group {
|
|||||||
node.setAttrs(attrs);
|
node.setAttrs(attrs);
|
||||||
this._fire('transform', { evt: evt, target: node });
|
this._fire('transform', { evt: evt, target: node });
|
||||||
node._fire('transform', { evt: evt, target: node });
|
node._fire('transform', { evt: evt, target: node });
|
||||||
|
node.getLayer()?.batchDraw();
|
||||||
});
|
});
|
||||||
this.rotation(Util._getRotation(newAttrs.rotation));
|
this.rotation(Util._getRotation(newAttrs.rotation));
|
||||||
this._resetTransformCache();
|
this._resetTransformCache();
|
||||||
|
Loading…
Reference in New Issue
Block a user