Fix scroll pane issues with drop down menus

This commit is contained in:
drdev
2014-07-04 21:28:20 +00:00
parent 12bcc312ba
commit adc3ddf972
2 changed files with 9 additions and 2 deletions

View File

@@ -114,11 +114,14 @@ public abstract class FDropDown extends FScrollPane {
float maxVisibleHeight = screenHeight - VPrompt.HEIGHT - y; //prevent covering prompt
paneSize = updateAndGetPaneSize(screenWidth, maxVisibleHeight);
//round width and height so borders appear properly
paneSize = new ScrollBounds(Math.round(paneSize.getWidth()), Math.round(paneSize.getHeight()));
if (x + paneSize.getWidth() > screenWidth) {
x = screenWidth - paneSize.getWidth();
}
setBounds(Math.round(x), Math.round(y), Math.round(paneSize.getWidth()), Math.round(Math.min(paneSize.getHeight(), maxVisibleHeight)));
setBounds(Math.round(x), Math.round(y), paneSize.getWidth(), Math.min(paneSize.getHeight(), maxVisibleHeight));
}
@Override

View File

@@ -47,6 +47,10 @@ public abstract class FPopupMenu extends FDropDownMenu {
float screenHeight = screen.getHeight();
paneSize = updateAndGetPaneSize(screenWidth, screenHeight);
//round width and height so borders appear properly
paneSize = new ScrollBounds(Math.round(paneSize.getWidth()), Math.round(paneSize.getHeight()));
if (x + paneSize.getWidth() > screenWidth) {
x = screenWidth - paneSize.getWidth();
}
@@ -54,6 +58,6 @@ public abstract class FPopupMenu extends FDropDownMenu {
y = screenHeight - paneSize.getHeight();
}
setBounds(Math.round(x), Math.round(y), Math.round(paneSize.getWidth()), Math.round(paneSize.getHeight()));
setBounds(Math.round(x), Math.round(y), paneSize.getWidth(), paneSize.getHeight());
}
}