Image edge clipped when using affine transforms

Hi folks

While I write software for my day job, I've never done any game or graphics programming before, so I'm sorry if this is a silly question! I'm hoping Playdate will be my introduction to making games :smiley:

I've been playing around with the different graphics APIs through Lua, but I've found anything that does a "clean" affine transform, for example a reflection or a right-angle rotation, causes one edge of my image to be clipped off.

I have a 32x32 box guy that I'm testing with, and as you can see, while :drawRotated works fine, :drawWithTransform causes clipping. The only thing I have in my sprite layer is the black background. The x and y offsets on the transform shift things around as expected, but never result in the clipped edge being drawn.

Am I missing something obvious? Is it a bug? I'm running v1.9.0 of the SDK + Simulator, on macOS Monterey.

2 Likes

Yeah... this looks like a bug. I'm seeing the same thing on v1.9.1 of the SDK.

Here's the project I made to test. Only thing I did different from you was use affineTransform:rotate() to compute the transform, and it still shows missing pixels.

Here's the code:
test-transform.zip (82.9 KB)

3 Likes