Commit d7737d04 authored by wjf's avatar wjf

l

parent d711ec43
......@@ -537,11 +537,11 @@ export default class Container extends DisplayObject {
* 包括子级的,容器的尽量少用,子类可重写
* @member {number}
*/
get width() {
get width(): number {
return this._width || this.scale.x * this.getLocalBounds().width;
}
set width(value) {
set width(value: number) {
// const width = this.getLocalBounds().width;
// if (width !== 0) {
......@@ -549,6 +549,7 @@ export default class Container extends DisplayObject {
// } else {
// this.scale.x = 1;
// }
if (this._width !== value) this.dispatchEvent(Event.RESIZE)
//子类有用,有_width,才需设置scaleX
this._width = value
}
......@@ -557,11 +558,11 @@ export default class Container extends DisplayObject {
* 高度同width
* @member {number}
*/
get height() {
get height(): number {
return this._height || this.scale.y * this.getLocalBounds().height;
}
set height(value) {
set height(value: number) {
// const height = this.getLocalBounds().height;
// if (height !== 0) {
......@@ -569,7 +570,7 @@ export default class Container extends DisplayObject {
// } else {
// this.scale.y = 1;
// }
if (this._height !== value) this.dispatchEvent(Event.RESIZE)
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