mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
resize working, but flickering
This commit is contained in:
@@ -835,9 +835,9 @@ public class PSurfaceAWT implements PSurface {
|
||||
setFrameSize(); //wide, high);
|
||||
}
|
||||
setCanvasSize();
|
||||
if (frame != null) {
|
||||
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.
|
||||
@@ -1003,15 +1003,24 @@ public class PSurfaceAWT implements PSurface {
|
||||
if (farm.isVisible()) {
|
||||
Insets insets = farm.getInsets();
|
||||
Dimension windowSize = farm.getSize();
|
||||
|
||||
// JFrame (unlike java.awt.Frame) doesn't include the left/top
|
||||
// insets for placement (though it does seem to need them for
|
||||
// overall size of the window. Perhaps JFrame sets its coord
|
||||
// system so that (0, 0) is always the upper-left of the content
|
||||
// area. Which seems nice, but breaks any f*ing AWT-based code.
|
||||
setSize(windowSize.width - insets.left - insets.right,
|
||||
windowSize.height - insets.top - insets.bottom);
|
||||
|
||||
/*
|
||||
Rectangle newBounds =
|
||||
new Rectangle(0, 0, //insets.left, insets.top,
|
||||
windowSize.width - insets.left - insets.right,
|
||||
windowSize.height - insets.top - insets.bottom);
|
||||
|
||||
System.out.println(e);
|
||||
System.out.println(newBounds);
|
||||
|
||||
Rectangle oldBounds = canvas.getBounds();
|
||||
if (!newBounds.equals(oldBounds)) {
|
||||
// the ComponentListener in PApplet will handle calling size()
|
||||
@@ -1023,17 +1032,8 @@ public class PSurfaceAWT implements PSurface {
|
||||
// are still a little wonky on 1.7, especially on OS X.
|
||||
// This gives us a way to at least test against older VMs.
|
||||
canvas.revalidate(); // let the layout manager do its work
|
||||
/*
|
||||
if (revalidateMethod != null) {
|
||||
try {
|
||||
revalidateMethod.invoke(PApplet.this);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
revalidateMethod = null;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
0233 (3.0a6)
|
||||
s0233 (3.0a6)
|
||||
X remove Applet as base class
|
||||
X how to name the retina pixel stuff
|
||||
X hint(ENABLE_RETINA_PIXELS) or hint(ENABLE_HIDPI_PIXELS)
|
||||
@@ -59,6 +59,9 @@ _ https://github.com/processing/processing/issues/2963
|
||||
_ assign this to DXF as well?
|
||||
_ createGraphics() currently broken in Java2D
|
||||
_ size() command not working to do a resize
|
||||
_ fix flicker when resizing window
|
||||
_ running through PSurfaceAWT.setSize() is probably overkill
|
||||
_ setLocationRelativeTo(null) was removed, will it be missed?
|
||||
_ deal with applySettings() change (maybe not a problem?)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user