Commit 43919fd6 authored by wjf's avatar wjf

l

parent 85298eab
......@@ -1422,9 +1422,14 @@ export default class Graphics extends Container {
}
set width(value) {
const s = sign(this.scale.x) || 1;
this.scale.x = s * value / this._localBoundsSelf.width;
this.updateLocalBoundsSelf();
const width = this._localBoundsSelf.width;
if (width !== 0) {
const s = sign(this.scale.x) || 1;
this.scale.x = s * value / width;
} else {
this.scale.x = 1;
}
this._width = value;
}
......@@ -1439,8 +1444,14 @@ export default class Graphics extends Container {
}
set height(value) {
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._localBoundsSelf.height;
this.updateLocalBoundsSelf()
const height = this._localBoundsSelf.height;
if (height !== 0) {
const s = sign(this.scale.y) || 1;
this.scale.y = s * value / height;
} else {
this.scale.y = 1;
}
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