mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Fix scroll pane issues with drop down menus
This commit is contained in:
@@ -114,11 +114,14 @@ public abstract class FDropDown extends FScrollPane {
|
|||||||
|
|
||||||
float maxVisibleHeight = screenHeight - VPrompt.HEIGHT - y; //prevent covering prompt
|
float maxVisibleHeight = screenHeight - VPrompt.HEIGHT - y; //prevent covering prompt
|
||||||
paneSize = updateAndGetPaneSize(screenWidth, maxVisibleHeight);
|
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) {
|
if (x + paneSize.getWidth() > screenWidth) {
|
||||||
x = screenWidth - paneSize.getWidth();
|
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
|
@Override
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ public abstract class FPopupMenu extends FDropDownMenu {
|
|||||||
float screenHeight = screen.getHeight();
|
float screenHeight = screen.getHeight();
|
||||||
|
|
||||||
paneSize = updateAndGetPaneSize(screenWidth, screenHeight);
|
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) {
|
if (x + paneSize.getWidth() > screenWidth) {
|
||||||
x = screenWidth - paneSize.getWidth();
|
x = screenWidth - paneSize.getWidth();
|
||||||
}
|
}
|
||||||
@@ -54,6 +58,6 @@ public abstract class FPopupMenu extends FDropDownMenu {
|
|||||||
y = screenHeight - paneSize.getHeight();
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user