diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelIcon.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelIcon.java index ca11cc4c5581..6aadd0e10f26 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelIcon.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelIcon.java @@ -55,16 +55,16 @@ public class LabelIcon implements Icon { for (int i = myColors.length - 1; i >= 0; i--) { if (i != myColors.length - 1) { g2.setColor(myBgColor); - paintTag(g2, scale, Math.round(scale * 2) * i + 1, 0); + paintTag(g2, scale, scale * 2 * i + 1, 0); } g2.setColor(myColors[i]); - paintTag(g2, scale, Math.round(scale * 2) * i, 0); + paintTag(g2, scale, scale * 2 * i, 0); } config.restore(); } - public void paintTag(Graphics2D g2, float scale, int x, int y) { + public void paintTag(Graphics2D g2, float scale, float x, float y) { Path2D.Float path = new Path2D.Float(); path.moveTo(x + 1 * scale, y + 2 * scale); path.lineTo(x + 3 * scale, y + 2 * scale); @@ -89,7 +89,8 @@ public class LabelIcon implements Icon { } public static int getWidth(int height, int labelsCount) { - return height + (height * (labelsCount - 1) / 4); + float scale = height / 8.0f; + return (int)Math.ceil((7 + 2 * (labelsCount - 1)) * scale); } @Override diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelPainter.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelPainter.java index b9ae5684f1de..b031ab540540 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelPainter.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/LabelPainter.java @@ -62,7 +62,8 @@ public class LabelPainter { public static final int BOTTOM_TEXT_PADDING = JBUI.scale(2); public static final int RIGHT_PADDING = JBUI.scale(2); public static final int LEFT_PADDING = JBUI.scale(2); - public static final int MIDDLE_PADDING = JBUI.scale(2); + public static final int COMPACT_MIDDLE_PADDING = JBUI.scale(2); + public static final int MIDDLE_PADDING = JBUI.scale(6); private static final int MAX_LENGTH = 22; private static final String THREE_DOTS = "..."; private static final String TWO_DOTS = ".."; @@ -154,7 +155,7 @@ public class LabelPainter { for (RefGroup group : refGroups) { List colors = group.getColors(); LabelIcon labelIcon = new LabelIcon(height, background, colors.toArray(new Color[colors.size()])); - int newWidth = width + labelIcon.getIconWidth() + MIDDLE_PADDING; + int newWidth = width + labelIcon.getIconWidth() + COMPACT_MIDDLE_PADDING; String text = shortenRefName(group.getName(), fontMetrics, availableWidth - newWidth); newWidth += fontMetrics.stringWidth(text); @@ -335,7 +336,7 @@ public class LabelPainter { g2.setColor(myForeground); g2.drawString(text, x, y + baseLine); - x += fontMetrics.stringWidth(text) + MIDDLE_PADDING; + x += fontMetrics.stringWidth(text) + (myCompact ? COMPACT_MIDDLE_PADDING : MIDDLE_PADDING); } config.restore(); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/TooltipReferencesPanel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/TooltipReferencesPanel.java index 7e4135184c28..08ff19f8221c 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/TooltipReferencesPanel.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/TooltipReferencesPanel.java @@ -52,13 +52,13 @@ class TooltipReferencesPanel extends ReferencesPanel { @Override public void update() { - super.update(); myHasGroupWithMultipleRefs = false; for (Map.Entry> typeAndRefs : myGroupedVisibleReferences.entrySet()) { if (typeAndRefs.getValue().size() > 1) { myHasGroupWithMultipleRefs = true; } } + super.update(); } @NotNull