diff --git a/cocos2d/core/components/CCLayout.js b/cocos2d/core/components/CCLayout.js index dd4dae7716..b32fe35b3d 100644 --- a/cocos2d/core/components/CCLayout.js +++ b/cocos2d/core/components/CCLayout.js @@ -205,6 +205,7 @@ var Layout = cc.Class({ children.forEach(function(child) { child.on('size-changed', this._doLayoutDirty, this); child.on('position-changed', this._doLayoutDirty, this); + child.on('anchor-changed', this._doLayoutDirty, this); }.bind(this)); }, diff --git a/cocos2d/core/utils/base-node.js b/cocos2d/core/utils/base-node.js index 16447dc385..3d0ab9ef4d 100644 --- a/cocos2d/core/utils/base-node.js +++ b/cocos2d/core/utils/base-node.js @@ -887,10 +887,8 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{ * @return {Rect} The calculated bounding box of the node */ getBoundingBox: function () { - var boundingBox = this._sgNode.getBoundingBox(); - boundingBox.width = this._contentSize.width; - boundingBox.height = this._contentSize.height; - return boundingBox; + var rect = cc.rect(0, 0, this._contentSize.width, this._contentSize.height); + return cc._rectApplyAffineTransformIn(rect, this.getNodeToParentTransform()); }, /**