From 191b910f23797a867d0f305dc3cca172cf378322 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 8 Aug 2014 18:49:11 -0300 Subject: [PATCH] Fixed love.graphics.newScreenshot potentially deleting any active Canvases. --- src/modules/graphics/opengl/Graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index f42129f84..f2289ec37 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -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 canvases = getCanvas(); + std::vector> 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 canvases = getCanvas(); + std::vector> canvases = states.back().canvases; setCanvas(); int w = getWidth();