Fix Display.getWidth() and Display.getHeight() to return the correct values on OS X when the window has been resized.

This commit is contained in:
kappa1 2012-04-14 18:55:40 +00:00
parent d2174850be
commit 6f40eeb58a
1 changed files with 10 additions and 0 deletions

View File

@ -110,6 +110,16 @@ final class MacOSXFrame extends Frame implements WindowListener, ComponentListen
Insets insets = getInsets();
setBounds(x, y, width + insets.left + insets.right, height + insets.top + insets.bottom);
}
public int getWidth() {
Insets insets = getInsets();
return super.getWidth() - insets.left - insets.right;
}
public int getHeight() {
Insets insets = getInsets();
return super.getHeight() - insets.top - insets.bottom;
}
public Rectangle syncGetBounds() {
synchronized ( this ) {