mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28: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) {
|
if (visible0) {
|
||||||
updateSizeAndPosition();
|
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 = new Backdrop();
|
||||||
backdrop.setSize(container.getWidth(), container.getHeight());
|
backdrop.setSize(container.getWidth(), container.getHeight());
|
||||||
container.add(backdrop);
|
container.add(backdrop);
|
||||||
@@ -203,7 +203,7 @@ public abstract class FDropDown extends FScrollPane {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean press(float x, float y) {
|
public boolean press(float x, float y) {
|
||||||
if (hideBackdropOnPress(x, y)) {
|
if (hideBackdropOnPress(localToScreenX(x), y)) {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
return false; //allow press to pass through to object behind backdrop
|
return false; //allow press to pass through to object behind backdrop
|
||||||
|
|||||||
@@ -147,6 +147,9 @@ public abstract class FScreen extends FContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawBackground(Graphics g) {
|
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 w = getWidth();
|
||||||
float h = getHeight();
|
float h = getHeight();
|
||||||
g.drawImage(FSkinTexture.BG_TEXTURE, 0, 0, w, h);
|
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();
|
FScreen screen = Forge.getCurrentScreen();
|
||||||
float screenHeight = screen.getHeight();
|
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 y = FComboBox.this.localToScreenY(FComboBox.this.getHeight());
|
||||||
|
|
||||||
float maxVisibleHeight = screenHeight - y;
|
float maxVisibleHeight = screenHeight - y;
|
||||||
|
|||||||
Reference in New Issue
Block a user