Skip to content

Commit

Permalink
fix resizing of 9-slice sprites (thanks @NemoStein)
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Aug 8, 2022
1 parent 2c56c90 commit b0ee2b2
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/renderable/nineslicesprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,40 @@ class NineSliceSprite extends Sprite {
this.width = Math.floor(settings.width);
this.height = Math.floor(settings.height);

// nine slice sprite specific local variables
// nine slice sprite specific internal variables
this.nss_width = this.width;
this.nss_height = this.height;

this.insetx = settings.insetx;
this.insety = settings.insety;
}

/**
* width of the NineSliceSprite
* @public
* @type {number}
* @name width
*/
get width() {
return super.width;
}
set width(value) {
super.width = this.nss_width = value;
}

/**
* height of the NineSliceSprite
* @public
* @type {number}
* @name height
*/
get height() {
return super.height;
}
set height(value) {
super.height = this.nss_height = value;
}

/**
* @ignore
*/
Expand Down

1 comment on commit b0ee2b2

@obiot
Copy link
Member Author

@obiot obiot commented on b0ee2b2 Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #1115

Please sign in to comment.