Merge pull request #194 from jareguo/v0.7

node should emit a size parameter if size changed
This commit is contained in:
Jare Guo
2016-01-06 23:22:36 +08:00
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ function checkUrl (val, className, propName, url) {
return cc.error('The "url" type of "%s.%s" must be child class of cc.RawAsset.', className, propName);
}
if (cc.isChildClassOf(url, cc.Asset)) {
return cc.error('The "url" type of "%s.%s" must not be child class of cc.Asset,' +
return cc.error('The "url" type of "%s.%s" must not be child class of cc.Asset, ' +
'otherwise you should use "type: %s" instead.', className, propName, cc.js.getClassName(url));
}
if (val.type) {
+2 -2
View File
@@ -450,7 +450,7 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{
if (this._sizeProvider) {
this._sizeProvider.setContentSize(value, this._sizeProvider._getHeight());
}
var clone = cc.v2(this._contentSize);
var clone = cc.size(this._contentSize);
this._contentSize.width = value;
this.emit(SIZE_CHANGED, clone);
}
@@ -478,7 +478,7 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{
if (this._sizeProvider) {
this._sizeProvider.setContentSize(this._sizeProvider._getWidth(), value);
}
var clone = cc.v2(this._contentSize);
var clone = cc.size(this._contentSize);
this._contentSize.height = value;
this.emit(SIZE_CHANGED, clone);
}
+1 -1
View File
@@ -28,7 +28,7 @@
/**
* Define an enum type. If a enum item has a value of -1, it will be given an Integer number according to it's order in the list. Otherwise it will use the value specified by user who writes the enum definition.
* @method defineEnum
* @method Enum
* @param {object} obj - a JavaScript literal object containing enum names and values
* @return {object} the defined enum type
*