mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Merge pull request #194 from jareguo/v0.7
node should emit a size parameter if size changed
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user