DrawRotatedBitmap rendering error when rendering out of bounds at specific angles

I found a rendering error that happens only in a very specific case.

When you render a bitmap rotated 90 degrees exactly partially out of the right side of the screen (or a bitmap rotated 270 degrees partially out of the left side of the screen), a rendering artefact occurs. The gif below demonstrate this error:
RenderingError

(This error has only been tested on simulator, and I don't know if it occurs on console as well)

I am experiencing a similar issue with playdate.graphics.image:drawRotated

error

In the gif, I have images that are from an image table being drawn within an image-less-sprite's drawFunction. The images are being rotated. When they leave the screen, the image becomes invisible (even though the sprite's isVisible property remains true). In the gif, you can see an invisible image return to the screen (after being forced out of bounds) as just an unfilled circle (I am drawing these primitive circle shapes for debugging purposes).

There appears to be no way to solve this issue using the existing SDK

Literal edge cases. :stuck_out_tongue: My hunch is the two aren't related (not that that matters at all) but they're equally annoying. It's in the tracker now, will fix as soon as I can.

2 Likes

Popping in here to bump this this as I'm still seeing this issue on device and simulator with SDK 2.1.1.

rotate-bug

Code used to demo the repro in the GIF:

import("CoreLibs/graphics")

local image = playdate.graphics.image.new("asteroid")
local x = 400
local angle = 90
function playdate.update()
  playdate.graphics.clear()

  playdate.graphics.fillCircleAtPoint(x, 50, 16)
  image:drawRotated(x, 120, angle)

  if playdate.buttonIsPressed("left") then
    x = x - 2
  elseif playdate.buttonIsPressed("right") then
    x = x + 2
  end

  if playdate.buttonJustPressed("up") then
    angle = angle + 2
  elseif playdate.buttonJustPressed("down") then
    angle = angle - 2
  end

  playdate.graphics.drawText("angle="..angle, 0, 0)
end
1 Like

I've got a fix in for this, at last, scheduled for the next update. Thank you so much for the demo! :pray:

Fix is out today. Please let us know if it doesn't do the trick!

1 Like

Thanks for the update, looks like that did the trick :tada: