mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:55:17 +08:00
Improved _getAbsoluteTransform() when transformEnabled != 'all'
Only call getTransform() inside _getAbsoluteTransform() when the transformEnabled property is set to 'all'. That also eliminates the need in extra variable (trans) to reference the returned value.
This commit is contained in:
parent
39e022e786
commit
556a58f9dd
@ -1428,16 +1428,14 @@
|
||||
},
|
||||
_getAbsoluteTransform: function(top) {
|
||||
var at = new Konva.Transform(),
|
||||
transformsEnabled,
|
||||
trans;
|
||||
transformsEnabled;
|
||||
|
||||
// start with stage and traverse downwards to self
|
||||
this._eachAncestorReverse(function(node) {
|
||||
transformsEnabled = node.transformsEnabled();
|
||||
trans = node.getTransform();
|
||||
|
||||
if (transformsEnabled === 'all') {
|
||||
at.multiply(trans);
|
||||
at.multiply(node.getTransform());
|
||||
} else if (transformsEnabled === 'position') {
|
||||
at.translate(node.x(), node.y());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user