mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 04:14:52 +08:00
update rotation of transformer automatically. close #976
This commit is contained in:
@@ -665,7 +665,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* @method
|
||||
* @name Konva.Node#on
|
||||
* @param {String} evtStr e.g. 'click', 'mousedown touchstart', 'mousedown.foo touchstart.foo'
|
||||
* @param {Function} handler The handler function is passed an event object
|
||||
* @param {Function} handler The handler function. The first argument of that function is event object. Event object has `target` as main target of the event, `currentTarget` as current node listener and `evt` as native browser event.
|
||||
* @returns {Konva.Node}
|
||||
* @example
|
||||
* // add click listener
|
||||
|
@@ -292,6 +292,11 @@ export class Transformer extends Group {
|
||||
.join(' ');
|
||||
|
||||
const onChange = () => {
|
||||
//
|
||||
if (this.nodes().length === 1) {
|
||||
this.rotation(this.nodes()[0].rotation());
|
||||
}
|
||||
|
||||
this._resetTransformCache();
|
||||
if (!this._transforming) {
|
||||
this.update();
|
||||
|
Reference in New Issue
Block a user