A negative scale value crashed the simulator (OSX)

Sample code:

import 'CoreLibs/graphics'
import 'CoreLibs/sprites'

Test = {}
Test.__index = Test

function Test:new()

	local self = playdate.graphics.sprite:new()
	local picture = playdate.graphics.image.new('images/test.png')
	self:setImage(picture)
	self:setCenter(0,0)
	self:setScale(-.5) -- this line!
	return self
end

local test = Test:new()
test:addSprite()

function playdate.update()
	playdate.graphics.sprite.update()
end
1 Like

I just encountered this as well. I (maybe naively) expected a negative scale to flip the image.

1 Like

Thanks for catching this! A fix that will be included in the next SDK release (bonus: negative values will flip the image as you’d expect. Good idea @veubeke!)

5 Likes