fix wrong sprite scale
This commit is contained in:
parent
665e10fa30
commit
da001601e5
1 changed files with 1 additions and 1 deletions
|
|
@ -21,8 +21,8 @@ fn void? Ctx.sprite_id(&ctx, Id id, String name, short size = 0)
|
||||||
short height = sprite.h;
|
short height = sprite.h;
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
if (sprite.w >= sprite.h) {
|
if (sprite.w >= sprite.h) {
|
||||||
width = size;
|
|
||||||
height = (short)(size * (float)height/width);
|
height = (short)(size * (float)height/width);
|
||||||
|
width = size;
|
||||||
} else {
|
} else {
|
||||||
width = (short)(size * (float)width/height);
|
width = (short)(size * (float)width/height);
|
||||||
height = size;
|
height = size;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue