diff --git a/CodenameOne/src/com/codename1/components/InteractionDialog.java b/CodenameOne/src/com/codename1/components/InteractionDialog.java index 69af6ce078..ee29150c04 100644 --- a/CodenameOne/src/com/codename1/components/InteractionDialog.java +++ b/CodenameOne/src/com/codename1/components/InteractionDialog.java @@ -761,11 +761,11 @@ public void showPopupDialog(Rectangle rect, boolean bias) { // if we don't have enough space then disregard device orientation if(showPortrait) { - if(availableHeight < (availableWidth - rect.getWidth()) / 2) { + if(availableHeight < prefHeight && availableHeight < (availableWidth - rect.getWidth()) / 2) { showPortrait = false; } } else { - if(availableHeight / 2 > availableWidth - rect.getWidth()) { + if(availableWidth < prefWidth && availableHeight / 2 > availableWidth - rect.getWidth()) { showPortrait = true; } }