mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +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
|
||||
// (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();
|
||||
|
||||
// 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
|
||||
// active framebuffer, not the main one.)
|
||||
std::vector<Canvas *> canvases = getCanvas();
|
||||
std::vector<Object::StrongRef<Canvas>> canvases = states.back().canvases;
|
||||
setCanvas();
|
||||
|
||||
int w = getWidth();
|
||||
|
||||
Reference in New Issue
Block a user