merge: fix rendering for resolved changes in merge

follow-up 95384fd370
This commit is contained in:
Aleksey Pivovarov
2016-07-25 13:25:03 +03:00
parent be465201ca
commit 3c8cba0ea0
2 changed files with 4 additions and 2 deletions
@@ -222,6 +222,7 @@ public class DiffDrawUtil {
@NotNull
private static LineSeparatorRenderer createDiffLineRenderer(@NotNull final Editor editor,
@NotNull final TextDiffType type,
@NotNull SeparatorPlacement placement,
final boolean doubleLine,
final boolean resolved) {
return new LineSeparatorRenderer() {
@@ -230,6 +231,7 @@ public class DiffDrawUtil {
// TODO: change LineSeparatorRenderer interface ?
Rectangle clip = g.getClipBounds();
x2 = clip.x + clip.width;
if (placement == SeparatorPlacement.TOP) y++;
drawChunkBorderLine((Graphics2D)g, x1, x2, y, type.getColor(editor), doubleLine, resolved);
}
};
@@ -504,7 +506,7 @@ public class DiffDrawUtil {
@NotNull
public LineMarkerBuilder withDefaultRenderer(boolean doubleLine) {
assert type != null;
this.renderer = createDiffLineRenderer(editor, type, doubleLine, resolved);
this.renderer = createDiffLineRenderer(editor, type, placement, doubleLine, resolved);
return this;
}
@@ -102,7 +102,7 @@ class DiffLineMarkerRenderer implements LineMarkerRendererEx {
g2.setColor(ignoredBackgroundColor ? myDiffType.getIgnoredColor(editor) : color);
g2.fillRect(x1, y1, x2 - x1, y2 - y1);
} else {
DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y1 - 1, color, false, myResolved);
DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y1, color, false, myResolved);
DiffDrawUtil.drawChunkBorderLine(g2, x1, x2, y2 - 1, color, false, myResolved);
}
}