mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-130294 Draw line highlighters with no gap to the gutter splitter
This commit is contained in:
+12
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user