@Override
public void paint(Editor editor, Graphics g, Rectangle range) {
- Color color = myDiffType.getColor(editor);
-
EditorGutterComponentEx gutter = ((EditorEx)editor).getGutterComponentEx();
Graphics2D g2 = (Graphics2D)g;
int x1 = 0;
int y = range.y;
int height = range.height;
- if (height > 2) {
- if (!myResolved) {
- if (myIgnoredFoldingOutline) {
- int xOutline = gutter.getWhitespaceSeparatorOffset();
+ int annotationsOffset = gutter.getAnnotationsAreaOffset();
+ int annotationsWidth = gutter.getAnnotationsAreaWidth();
+ if (annotationsWidth != 0) {
+ drawMarker(editor, g2, x1, annotationsOffset, y, height, false);
+ x1 = annotationsOffset + annotationsWidth;
+ }
- g.setColor(myDiffType.getIgnoredColor(editor));
- g.fillRect(xOutline, y, x2 - xOutline, height);
+ if (myIgnoredFoldingOutline) {
+ int xOutline = gutter.getWhitespaceSeparatorOffset();
+ drawMarker(editor, g2, xOutline, x2, y, height, true);
+ drawMarker(editor, g2, x1, xOutline, y, height, false);
+ } else {
+ drawMarker(editor, g2, x1, x2, y, height, false);
+ }
+ }
- g.setColor(color);
- g.fillRect(x1, y, xOutline - x1, height);
- }
- else {
- g.setColor(color);
- g.fillRect(x1, y, x2 - x1, height);
- }
+ private void drawMarker(Editor editor, Graphics2D g2,
+ int x1, int x2, int y, int height,
+ boolean ignoredOutline) {
+ Color color = myDiffType.getColor(editor);
+ if (height > 2) {
+ if (ignoredOutline) {
+ g2.setColor(myDiffType.getIgnoredColor(editor));
}
+ else {
+ g2.setColor(color);
+ }
+ if (!myResolved) g2.fillRect(x1, y, x2 - x1, height);
+
DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y - 1, color, false, myResolved);
DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y + height - 1, color, false, myResolved);
}
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.colors.ColorKey;
+import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.editor.markup.LineMarkerRenderer;
import com.intellij.openapi.editor.markup.LineSeparatorRenderer;
import com.intellij.openapi.ui.GraphicsConfig;
int y = r.y;
int lineHeight = myEditor.getLineHeight();
+ EditorGutterComponentEx gutter = ((EditorEx)editor).getGutterComponentEx();
+ int annotationsOffset = gutter.getAnnotationsAreaOffset();
+ int annotationsWidth = gutter.getAnnotationsAreaWidth();
+ if (annotationsWidth != 0) {
+ g.setColor(editor.getColorsScheme().getColor(EditorColors.GUTTER_BACKGROUND));
+ g.fillRect(annotationsOffset, y, annotationsWidth, lineHeight);
+ }
+
draw(g, 0, y, lineHeight, myEditor.getColorsScheme());
}
int height = getHeight(lineHeight);
Rectangle clip = g.getClipBounds();
+ if (clip.width <= 0) return;
int count = (clip.width / step + 3);
int shift = (clip.x - shiftX) / step;