1. Anders Ruud
  2. love
  3. Issues


Issue #817 resolved

Drawing to canvas breaks scissor coordinates, even when not drawing to canvas

Dan Hagerstrand
created an issue

While working on my game (Santacid), I used Canvas + Shaders for a special effect and noticed serious offset/clipping issues when changing scissors coordinates (as a result of a window resize) to be something other than the size of the Canvas object. I half-fixed it in my game by disabling scissors in the level that was having issues, but then the rest of the game continued to have clipping problems even though no canvas drawing occurred.

The bad offset + clipping only occurs along the Y axis. See attached screenshot and .love file.

I noticed a similar defect had already been written up here, though it pertains to use of scissors inside of canvas drawing. This is about scissors outside of canvas drawing, after the canvas drawing has occurred.

When no canvas drawing is performed, the bug fixes itself when the scissor coordinates change. Because the only state being saved by this test .love is whether or not the canvas is enabled, it definitely looks like an issue with LOVE.

Comments (3)

  1. Alex Szpakowski

    The graphics viewport is now properly restored when switching from an active Canvas to no Canvas (resolves issue #817)

    → <<cset 496f625044e5>>

    Thanks for the report!

    LÖVE 0.9.0 added some new internally cached state to deal with older bugs with viewports and scissors, but one of the functions called when switching from an active canvas to no canvas ignored the cached state and screwed things up. Hopefully it's fixed now.

  2. Lap

    It most certainly is fixed. I just spent a few hours trying to figure out how I screwed up porting to 0.9 since all my scissor functions were screwing up. I wish I had looked this up sooner.

  3. Log in to comment