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:
Aleksey Pivovarov
2015-03-11 15:06:38 +03:00
parent 3d628750c8
commit ebe6949d6e
@@ -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,