non resizable windows glitch fixed
sometimes non resizable windows would have the incorrect dimensions,
causing them to render slightly incorrectly. this is cause by a margin
in windows inside the JFrame of {25, 3, 3, 3}. essentially a timing
issue.
master
parent
13c3448ab3
commit
9ec7c17b54
|
|
@ -307,7 +307,6 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
|
||||||
* @param resizable
|
* @param resizable
|
||||||
*/
|
*/
|
||||||
private static void setWindowProperties(Dimension dimension, boolean resizable) {
|
private static void setWindowProperties(Dimension dimension, boolean resizable) {
|
||||||
frame.setResizable(resizable);
|
|
||||||
staticMain.setSize(dimension);
|
staticMain.setSize(dimension);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
frame.setLocationRelativeTo(null);
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
@ -318,6 +317,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
|
||||||
BUFFER_WIDTH = WIDTH*(retina?2:1);
|
BUFFER_WIDTH = WIDTH*(retina?2:1);
|
||||||
apps[app].updateDimensions(BUFFER_WIDTH, BUFFER_HEIGHT);
|
apps[app].updateDimensions(BUFFER_WIDTH, BUFFER_HEIGHT);
|
||||||
staticMain.createBuffer();
|
staticMain.createBuffer();
|
||||||
|
frame.setResizable(resizable);
|
||||||
frame.pack();
|
frame.pack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue