love2d / website

Issue tracker for the LÖVE website.
https://love2d.org/
3 stars 1 forks source link

Canvas:renderTo is documented incorrectly #20

Closed lolbinarycat closed 10 months ago

lolbinarycat commented 10 months ago

i know i could make a forum account and fix the docs but i really don't feel like making a new account right now, sorry.

the api docs say that the function sets the current canvas to point to the screen afterwards, but actually it resores it to the previous value.

the equivelent lua would be this:

local oldcanvas = love.graphics.getCanvas()
love.graphics.setCanvas( canvas )
func()
love.graphics.setCanvas(oldcanvas)

the described behavior seemed wrong and likely to introduce subtle bugs, i was going to file a bug report to change the behavior, but first checked where the function is defined in the source code, to see if the documentation was incorrect (it is).

lolbinarycat commented 10 months ago

in case it isn't clear when this difference matters: calling renderTo when the output canvas has already been changed.

slime73 commented 10 months ago

I've edited the wiki page, but like the readme here says anyone with a forum account can do the same. The git repositories here are for source code and functionality rather than documentation work.

zorggn commented 10 months ago

Alternatively there's also a Discord server you could have posted this on.