mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1567 from cocos-creator/v1.4-mahjong
merge V1.4 mahjong
This commit is contained in:
@@ -474,9 +474,12 @@ var Node = cc.Class({
|
||||
}
|
||||
},
|
||||
|
||||
//statics: {
|
||||
// _DirtyFlags: require('./utils/misc').DirtyFlags
|
||||
//},
|
||||
statics: {
|
||||
// is node but not scene
|
||||
isNode: function (obj) {
|
||||
return obj instanceof Node && (obj.constructor === Node || !(obj instanceof cc.Scene));
|
||||
}
|
||||
},
|
||||
|
||||
// OVERRIDES
|
||||
|
||||
|
||||
@@ -409,10 +409,11 @@ var activeWidgets = [];
|
||||
// updateAlignment from scene to node recursively
|
||||
function updateAlignment (node) {
|
||||
var parent = node._parent;
|
||||
if (parent) {
|
||||
if (cc.Node.isNode(parent)) {
|
||||
updateAlignment(parent);
|
||||
}
|
||||
var widget = node._widget;
|
||||
var widget = node._widget ||
|
||||
node.getComponent(cc.Widget); // node._widget will be null when widget is disabled
|
||||
if (widget) {
|
||||
align(node, widget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user