EA-106299 - IAE: LogicalPosition.<init>

This commit is contained in:
Egor Ushakov
2017-12-06 20:27:30 +03:00
parent 741d8b2b67
commit 460b7f187d
@@ -99,8 +99,13 @@ public class DebuggerUIUtil {
@Nullable
public static RelativePoint getPositionForPopup(@NotNull Editor editor, int line) {
Point p = editor.logicalPositionToXY(new LogicalPosition(line + 1, 0));
return editor.getScrollingModel().getVisibleArea().contains(p) ? new RelativePoint(editor.getContentComponent(), p) : null;
if (line > -1) {
Point p = editor.logicalPositionToXY(new LogicalPosition(line + 1, 0));
if (editor.getScrollingModel().getVisibleArea().contains(p)) {
return new RelativePoint(editor.getContentComponent(), p);
}
}
return null;
}
public static void showPopupForEditorLine(@NotNull JBPopup popup, @NotNull Editor editor, int line) {