additional workaround for Canvas-only code

This commit is contained in:
Ben Fry
2014-11-20 18:01:48 -05:00
parent d24b858eff
commit 234f310dc1

View File

@@ -831,9 +831,13 @@ public class PSurfaceAWT implements PSurface {
// canvas.setSize(wide, high);
// frame.setSize(wide, high);
setFrameSize(); //wide, high);
if (frame != null) { // canvas only
setFrameSize(); //wide, high);
}
setCanvasSize();
frame.setLocationRelativeTo(null);
if (frame != null) {
frame.setLocationRelativeTo(null);
}
GraphicsConfiguration gc = canvas.getGraphicsConfiguration();
// If not realized (off-screen, i.e the Color Selector Tool), gc will be null.