Fixed screenshots in GPU mode with stretching enabled.

This commit is contained in:
Daniel Bolya
2018-11-26 18:59:54 -08:00
parent c9713b080d
commit c4a2ac6c81

View File

@@ -1154,8 +1154,15 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
*/
private Image screenshot()
{
final int width = client.getCanvasWidth();
final int height = client.getCanvasHeight();
int width = client.getCanvasWidth();
int height = client.getCanvasHeight();
if (client.isStretchedEnabled())
{
Dimension dim = client.getStretchedDimensions();
width = dim.width;
height = dim.height;
}
ByteBuffer buffer = ByteBuffer.allocateDirect(width * height * 4)
.order(ByteOrder.nativeOrder());