mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
fixed get node scale property
This commit is contained in:
@@ -46,8 +46,8 @@ function getReadonlyNodeSize (parent) {
|
||||
}
|
||||
|
||||
function computeInverseTransForTarget (widgetNode, target, out_inverseTranslate, out_inverseScale) {
|
||||
var scaleX = widgetNode._parent._scaleX;
|
||||
var scaleY = widgetNode._parent._scaleY;
|
||||
var scaleX = widgetNode._parent._scale.x;
|
||||
var scaleY = widgetNode._parent._scale.y;
|
||||
var translateX = 0;
|
||||
var translateY = 0;
|
||||
for (var node = widgetNode._parent;;) {
|
||||
@@ -62,8 +62,8 @@ function computeInverseTransForTarget (widgetNode, target, out_inverseTranslate,
|
||||
return;
|
||||
}
|
||||
if (node !== target) {
|
||||
var sx = node._scaleX;
|
||||
var sy = node._scaleY;
|
||||
var sx = node._scale.x;
|
||||
var sy = node._scale.y;
|
||||
translateX *= sx;
|
||||
translateY *= sy;
|
||||
scaleX *= sx;
|
||||
@@ -126,7 +126,7 @@ function align (node, widget) {
|
||||
localRight *= inverseScale.x;
|
||||
}
|
||||
|
||||
var width, anchorX = anchor.x, scaleX = node._scaleX;
|
||||
var width, anchorX = anchor.x, scaleX = node._scale.x;
|
||||
if (scaleX < 0) {
|
||||
anchorX = 1.0 - anchorX;
|
||||
scaleX = -scaleX;
|
||||
@@ -183,7 +183,7 @@ function align (node, widget) {
|
||||
localTop *= inverseScale.y;
|
||||
}
|
||||
|
||||
var height, anchorY = anchor.y, scaleY = node._scaleY;
|
||||
var height, anchorY = anchor.y, scaleY = node._scale.y;
|
||||
if (scaleY < 0) {
|
||||
anchorY = 1.0 - anchorY;
|
||||
scaleY = -scaleY;
|
||||
|
||||
Reference in New Issue
Block a user