|
|
@ -387,16 +387,15 @@ class AutoCompletePopupWindow extends JWindow implements CaretListener, |
|
|
|
|
|
|
|
|
|
|
|
// Try to position to the right first (LTR)
|
|
|
|
// Try to position to the right first (LTR)
|
|
|
|
int x; |
|
|
|
int x; |
|
|
|
int dis = 5; |
|
|
|
|
|
|
|
if (ac.getTextComponentOrientation().isLeftToRight()) { |
|
|
|
if (ac.getTextComponentOrientation().isLeftToRight()) { |
|
|
|
x = getX() + getWidth() + dis; |
|
|
|
x = getX() + getWidth() + 5; |
|
|
|
if (x + descWindow.getWidth() > screenBounds.x + screenBounds.width) { // doesn't fit
|
|
|
|
if (x + descWindow.getWidth() > screenBounds.x + screenBounds.width) { // doesn't fit
|
|
|
|
x = getX() - dis - descWindow.getWidth(); |
|
|
|
x = getX() - 5 - descWindow.getWidth(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { // RTL
|
|
|
|
} else { // RTL
|
|
|
|
x = getX() - dis - descWindow.getWidth(); |
|
|
|
x = getX() - 5 - descWindow.getWidth(); |
|
|
|
if (x < screenBounds.x) { // Doesn't fit
|
|
|
|
if (x < screenBounds.x) { // Doesn't fit
|
|
|
|
x = getX() + getWidth() + dis; |
|
|
|
x = getX() + getWidth() + 5; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|