mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: better painting of separators
* fix connection with gutter in mirrored editor - adjust phase of line (connection is broken, if editor is scrolled - but we can't do anything about it - it's better to move line in sync with text)
This commit is contained in:
@@ -115,8 +115,19 @@ public class DiffLineSeparatorRenderer implements LineMarkerRenderer, LineSepara
|
||||
|
||||
final int gutterWidth = ((EditorEx)myEditor).getGutterComponentEx().getWidth();
|
||||
int lineHeight = myEditor.getLineHeight();
|
||||
int interval = 8;
|
||||
|
||||
draw(g, -gutterWidth, y, lineHeight);
|
||||
int shiftX = -interval; // skip zero index painting
|
||||
if (((EditorEx)myEditor).getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_LEFT) {
|
||||
int contentWidth = ((EditorEx)myEditor).getScrollPane().getViewport().getWidth();
|
||||
shiftX += contentWidth % interval - interval;
|
||||
shiftX += gutterWidth % interval - interval;
|
||||
}
|
||||
else {
|
||||
shiftX += -gutterWidth % interval - interval;
|
||||
}
|
||||
|
||||
draw(g, shiftX, y, lineHeight);
|
||||
}
|
||||
|
||||
private static void draw(@NotNull Graphics g,
|
||||
|
||||
Reference in New Issue
Block a user