Fix screenshot with hidpi scaling with GPU plugin

Fixes #12463
This commit is contained in:
Jacob Mischka
2020-10-03 19:41:53 -05:00
committed by Adam
parent 2f91100f17
commit 6946140d55

View File

@@ -1303,6 +1303,13 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
height = dim.height;
}
if (OSType.getOSType() != OSType.MacOS)
{
final AffineTransform t = ((Graphics2D) canvas.getGraphics()).getTransform();
width = getScaledValue(t.getScaleX(), width);
height = getScaledValue(t.getScaleY(), height);
}
ByteBuffer buffer = ByteBuffer.allocateDirect(width * height * 4)
.order(ByteOrder.nativeOrder());