mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: do not fail on editors with negative size
this can actually happen for some layouts, ex: BorderLayout
This commit is contained in:
@@ -198,6 +198,7 @@ public class DiffDividerDrawUtil {
|
||||
@NotNull
|
||||
private static LineRange getVisibleInterval(Editor editor) {
|
||||
Rectangle area = editor.getScrollingModel().getVisibleArea();
|
||||
if (area.height < 0) return new LineRange(0, 0);
|
||||
LogicalPosition position1 = editor.xyToLogicalPosition(new Point(0, area.y));
|
||||
LogicalPosition position2 = editor.xyToLogicalPosition(new Point(0, area.y + area.height));
|
||||
return new LineRange(position1.line, position2.line);
|
||||
|
||||
Reference in New Issue
Block a user