completion screen location update bug fix

This commit is contained in:
Manindra Moharana
2013-09-16 21:35:40 +05:30
parent 4fce0cad01
commit 82a3bfc6e6
3 changed files with 7 additions and 4 deletions

View File

@@ -720,6 +720,7 @@ public class TextArea extends JEditTextArea {
- getLineStartOffset(getCaretLine()));
location.y = lineToY(getCaretLine())
+ getPainter().getFontMetrics().getHeight();
log("TA position: " + location);
} catch (Exception e2) {
e2.printStackTrace();
return;
@@ -732,7 +733,9 @@ public class TextArea extends JEditTextArea {
suggestion = new CompletionPanel(this, position, subWord, defListModel,
location,editor);
else
suggestion.updateList(defListModel, subWord, position);
suggestion.updateList(defListModel, subWord,
new Point(getLocationOnScreen().x + location.x,
getLocationOnScreen().y + location.y), position);
suggestion.setVisible(true);
// requestFocusInWindow();
SwingUtilities.invokeLater(new Runnable() {