mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix combo box drop down for landscape
This commit is contained in:
@@ -91,7 +91,7 @@ public abstract class FDropDown extends FScrollPane {
|
||||
if (visible0) {
|
||||
updateSizeAndPosition();
|
||||
|
||||
if (autoHide()) { //add invisible backdrop if needed to allow auto-hiding when pressing outide drop down
|
||||
if (autoHide()) { //add invisible backdrop if needed to allow auto-hiding when pressing outside drop down
|
||||
backdrop = new Backdrop();
|
||||
backdrop.setSize(container.getWidth(), container.getHeight());
|
||||
container.add(backdrop);
|
||||
@@ -203,7 +203,7 @@ public abstract class FDropDown extends FScrollPane {
|
||||
|
||||
@Override
|
||||
public boolean press(float x, float y) {
|
||||
if (hideBackdropOnPress(x, y)) {
|
||||
if (hideBackdropOnPress(localToScreenX(x), y)) {
|
||||
hide();
|
||||
}
|
||||
return false; //allow press to pass through to object behind backdrop
|
||||
|
||||
@@ -147,6 +147,9 @@ public abstract class FScreen extends FContainer {
|
||||
|
||||
@Override
|
||||
protected void drawBackground(Graphics g) {
|
||||
if (Forge.isLandscapeMode() && getLandscapeBackdropScreen() != null) {
|
||||
return; //don't draw background if this screen has a backdrop
|
||||
}
|
||||
float w = getWidth();
|
||||
float h = getHeight();
|
||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class FComboBox<T> extends FTextField implements IComboBox<T> {
|
||||
FScreen screen = Forge.getCurrentScreen();
|
||||
float screenHeight = screen.getHeight();
|
||||
|
||||
float x = FComboBox.this.localToScreenX(0);
|
||||
float x = screen.screenToLocalX(FComboBox.this.localToScreenX(0));
|
||||
float y = FComboBox.this.localToScreenY(FComboBox.this.getHeight());
|
||||
|
||||
float maxVisibleHeight = screenHeight - y;
|
||||
|
||||
Reference in New Issue
Block a user