[Regression] Image scaling is broken in 1.13.3

Image scaling seems to be broken in 1.13.3.

The following code displays 2 sprites of the same image but the second sprite is scaled up 5 times.
The code used to work on 1.13.2, but no longer works on 1.13.3.
The simulator is running on Windows 10.

Here are the results:
1.13.2:
1.13.2

1.13.3
1.13.3

local img = gfx.image.new("images/plane2")
assert(img)

local sprOrig = gfx.sprite.new()
sprOrig:setImage(img, pd.geometry.kUnflipped)
sprOrig:moveTo(100, 120)
sprOrig:add()

local sprScale = gfx.sprite.new()
sprScale:setImage(img, pd.geometry.kUnflipped, 5)
sprScale:moveTo(300, 120)
sprScale:add()

github repo if needed: GitHub - Schyzophrenic/testSpriteScale

2 Likes

That's probably a side effect of Panic reverting the sprite system to pre-1.13.0 because of the slowdown it was causing. I'd scale the image using gfx.image:scaledImage() to work around this for now, or if the scaling is done in in CoreLibs/sprites, you can simply edit that file.

Yep, this got lost while reverting that ill-conceived sprite change. Huge thanks for catching it! We've got 1.13.4 just about ready to go so I'll see if I can squeeze a fix in there.

Oh, and thank you for the very concise and complete bug report! It made finding and fixing the bug quick and easy. :pray:

2 Likes

I didn't find any use of that scale argument in the season games or the SDK examples. Since it looks pretty rare we decided to push this fix to 1.13.5 so that it doesn't hold up the release of 1.13.4. Until then, a separate setScale() call should do the trick.

Thanks @dave . It is fine by me, my new game is not ready to be released yet so I hope the 1.13.5 will be made available by then.
Otherwise, there is a workaround as you said!

1 Like