Merge pull request #6706 from dbolya/GPU_Scaled_Fix_Screenshots

Fix screenshots in GPU mode with Stretched Mode enabled
This commit is contained in:
Adam
2018-11-27 21:01:08 -05:00
committed by GitHub

View File

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