mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Fix convertToWorldSpace calculation issue
This commit is contained in:
@@ -1574,8 +1574,10 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{
|
||||
// ensure transform computed
|
||||
cc.director._visitScene();
|
||||
}
|
||||
var worldPositionIgnoreAnchorPoint = this._sgNode.convertToWorldSpace(nodePoint);
|
||||
return cc.pSub(worldPositionIgnoreAnchorPoint, cc.p(this._anchorPoint.x * this._contentSize.width, this._anchorPoint.y * this._contentSize.height));
|
||||
var x = nodePoint.x - this._anchorPoint.x * this._contentSize.width;
|
||||
var y = nodePoint.y - this._anchorPoint.y * this._contentSize.height;
|
||||
var worldPositionIgnoreAnchorPoint = this._sgNode.convertToWorldSpace(cc.v2(x, y));
|
||||
return worldPositionIgnoreAnchorPoint;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user