mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
love.graphics.newScreenshot now uses the size of the current canvas (if applicable), instead of adding transparency or clipping to match the screen size
This commit is contained in:
@@ -243,6 +243,13 @@ int Graphics::getHeight() const
|
|||||||
return currentWindow->getHeight();
|
return currentWindow->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Graphics::getRenderWidth() const
|
||||||
|
{
|
||||||
|
if (Canvas::current)
|
||||||
|
return Canvas::current->getWidth();
|
||||||
|
return getWidth();
|
||||||
|
}
|
||||||
|
|
||||||
int Graphics::getRenderHeight() const
|
int Graphics::getRenderHeight() const
|
||||||
{
|
{
|
||||||
if (Canvas::current)
|
if (Canvas::current)
|
||||||
@@ -1072,8 +1079,8 @@ void Graphics::polygon(DrawMode mode, const float *coords, size_t count)
|
|||||||
|
|
||||||
love::image::ImageData *Graphics::newScreenshot(love::image::Image *image, bool copyAlpha)
|
love::image::ImageData *Graphics::newScreenshot(love::image::Image *image, bool copyAlpha)
|
||||||
{
|
{
|
||||||
int w = getWidth();
|
int w = getRenderWidth();
|
||||||
int h = getHeight();
|
int h = getRenderHeight();
|
||||||
|
|
||||||
int row = 4*w;
|
int row = 4*w;
|
||||||
|
|
||||||
|
|||||||
@@ -483,7 +483,9 @@ private:
|
|||||||
GLint matrixLimit;
|
GLint matrixLimit;
|
||||||
GLint userMatrices;
|
GLint userMatrices;
|
||||||
|
|
||||||
|
int getRenderWidth() const;
|
||||||
int getRenderHeight() const;
|
int getRenderHeight() const;
|
||||||
|
|
||||||
}; // Graphics
|
}; // Graphics
|
||||||
|
|
||||||
} // opengl
|
} // opengl
|
||||||
|
|||||||
Reference in New Issue
Block a user