mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Fixed love.graphics.newScreenshot potentially deleting any active Canvases.
This commit is contained in:
@@ -170,7 +170,7 @@ void Graphics::setViewportSize(int width, int height)
|
|||||||
|
|
||||||
// We want to affect the main screen, not any Canvas that's currently active
|
// We want to affect the main screen, not any Canvas that's currently active
|
||||||
// (not that any *should* be active when this is called.)
|
// (not that any *should* be active when this is called.)
|
||||||
std::vector<Canvas *> canvases = getCanvas();
|
std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
|
||||||
setCanvas();
|
setCanvas();
|
||||||
|
|
||||||
// Set the viewport to top-left corner.
|
// Set the viewport to top-left corner.
|
||||||
@@ -1075,7 +1075,7 @@ love::image::ImageData *Graphics::newScreenshot(love::image::Image *image, bool
|
|||||||
{
|
{
|
||||||
// Temporarily unbind the currently active canvas (glReadPixels reads the
|
// Temporarily unbind the currently active canvas (glReadPixels reads the
|
||||||
// active framebuffer, not the main one.)
|
// active framebuffer, not the main one.)
|
||||||
std::vector<Canvas *> canvases = getCanvas();
|
std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
|
||||||
setCanvas();
|
setCanvas();
|
||||||
|
|
||||||
int w = getWidth();
|
int w = getWidth();
|
||||||
|
|||||||
Reference in New Issue
Block a user