Fix combo box drop down for landscape

This commit is contained in:
drdev
2015-05-09 21:21:41 +00:00
parent cce0f45149
commit b0cd90b8e7
3 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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;