mirror of
https://github.com/konvajs/konva.git
synced 2026-01-22 03:11:53 +08:00
Merge pull request #417 from VladimirTechMan/master
Small improvement to _getAbsoluteTransform() when transformEnabled is not set to 'all'
This commit is contained in:
@@ -1428,16 +1428,14 @@
|
|||||||
},
|
},
|
||||||
_getAbsoluteTransform: function(top) {
|
_getAbsoluteTransform: function(top) {
|
||||||
var at = new Konva.Transform(),
|
var at = new Konva.Transform(),
|
||||||
transformsEnabled,
|
transformsEnabled;
|
||||||
trans;
|
|
||||||
|
|
||||||
// start with stage and traverse downwards to self
|
// start with stage and traverse downwards to self
|
||||||
this._eachAncestorReverse(function(node) {
|
this._eachAncestorReverse(function(node) {
|
||||||
transformsEnabled = node.transformsEnabled();
|
transformsEnabled = node.transformsEnabled();
|
||||||
trans = node.getTransform();
|
|
||||||
|
|
||||||
if (transformsEnabled === 'all') {
|
if (transformsEnabled === 'all') {
|
||||||
at.multiply(trans);
|
at.multiply(node.getTransform());
|
||||||
} else if (transformsEnabled === 'position') {
|
} else if (transformsEnabled === 'position') {
|
||||||
at.translate(node.x(), node.y());
|
at.translate(node.x(), node.y());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user