Merge pull request #1567 from cocos-creator/v1.4-mahjong

merge V1.4 mahjong
This commit is contained in:
Wang Nan
2017-03-24 14:33:49 +08:00
committed by GitHub
2 changed files with 9 additions and 5 deletions
+6 -3
View File
@@ -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
+3 -2
View File
@@ -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);
}