IDEA-130294 Draw line highlighters with no gap to the gutter splitter

This commit is contained in:
Egor.Ushakov
2014-09-26 17:24:58 +04:00
parent 32082ecc48
commit ad68ba1afc
2 changed files with 13 additions and 5 deletions
@@ -226,12 +226,20 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
}
private void paintEditorBackgrounds(Graphics g, Rectangle clip, int firstVisibleOffset, int lastVisibleOffset) {
int startX = getWhitespaceSeparatorOffset() + 1;
IterationState state = new IterationState(myEditor, firstVisibleOffset, lastVisibleOffset, false, true);
while (!state.atEnd()) {
g.setColor(state.getMergedAttributes().getBackgroundColor());
int startX = getWhitespaceSeparatorOffset() + 1;
int y = myEditor.visualPositionToXY(myEditor.offsetToVisualPosition(state.getStartOffset())).y;
g.fillRect(startX, y, clip.width - startX, myEditor.getLineHeight());
VisualPosition logicalStart = myEditor.offsetToVisualPosition(state.getStartOffset());
int startY = myEditor.visualPositionToXY(logicalStart).y;
int endY = myEditor.visualPositionToXY(myEditor.offsetToVisualPosition(state.getEndOffset())).y;
if (logicalStart.getColumn() == 0) {
g.setColor(myEditor.getBackgroundColor(state.getMergedAttributes()));
g.fillRect(startX, startY, clip.width - startX, endY - startY + myEditor.getLineHeight());
}
else if (startY != endY) {
g.setColor(myEditor.getBackgroundColor(state.getMergedAttributes()));
g.fillRect(startX, startY + myEditor.getLineHeight(), clip.width - startX, endY - startY + myEditor.getLineHeight());
}
state.advance();
}
}
@@ -2100,7 +2100,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
myPlaceholderText = text;
}
private Color getBackgroundColor(@NotNull final TextAttributes attributes) {
Color getBackgroundColor(@NotNull final TextAttributes attributes) {
final Color attrColor = attributes.getBackgroundColor();
return Comparing.equal(attrColor, myScheme.getDefaultBackground()) ? getBackgroundColor() : attrColor;
}