Commit d7737d04 authored by wjf's avatar wjf

l

parent d711ec43
...@@ -537,11 +537,11 @@ export default class Container extends DisplayObject { ...@@ -537,11 +537,11 @@ export default class Container extends DisplayObject {
* 包括子级的,容器的尽量少用,子类可重写 * 包括子级的,容器的尽量少用,子类可重写
* @member {number} * @member {number}
*/ */
get width() { get width(): number {
return this._width || this.scale.x * this.getLocalBounds().width; return this._width || this.scale.x * this.getLocalBounds().width;
} }
set width(value) { set width(value: number) {
// const width = this.getLocalBounds().width; // const width = this.getLocalBounds().width;
// if (width !== 0) { // if (width !== 0) {
...@@ -549,6 +549,7 @@ export default class Container extends DisplayObject { ...@@ -549,6 +549,7 @@ export default class Container extends DisplayObject {
// } else { // } else {
// this.scale.x = 1; // this.scale.x = 1;
// } // }
if (this._width !== value) this.dispatchEvent(Event.RESIZE)
//子类有用,有_width,才需设置scaleX //子类有用,有_width,才需设置scaleX
this._width = value this._width = value
} }
...@@ -557,11 +558,11 @@ export default class Container extends DisplayObject { ...@@ -557,11 +558,11 @@ export default class Container extends DisplayObject {
* 高度同width * 高度同width
* @member {number} * @member {number}
*/ */
get height() { get height(): number {
return this._height || this.scale.y * this.getLocalBounds().height; return this._height || this.scale.y * this.getLocalBounds().height;
} }
set height(value) { set height(value: number) {
// const height = this.getLocalBounds().height; // const height = this.getLocalBounds().height;
// if (height !== 0) { // if (height !== 0) {
...@@ -569,7 +570,7 @@ export default class Container extends DisplayObject { ...@@ -569,7 +570,7 @@ export default class Container extends DisplayObject {
// } else { // } else {
// this.scale.y = 1; // this.scale.y = 1;
// } // }
if (this._height !== value) this.dispatchEvent(Event.RESIZE)
this._height = value this._height = value
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment