diff options
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java index 412a3d4d53..c93334c764 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/SWTPlotRenderer.java @@ -152,6 +152,12 @@ class SWTPlotRenderer extends AbstractPlotRenderer<SWTLane, Color> { if (txt.length() > 12) txt = txt.substring(0,11) + "\u2026"; // ellipsis "..." (in UTF-8) //$NON-NLS-1$ + // highlight checked out branch + Font oldFont = g.getFont(); + boolean isHead = isHead(name); + if (isHead) + g.setFont(CommitGraphTable.highlightFont()); + Point textsz = g.stringExtent(txt); int arc = textsz.y/2; final int texty = (y * 2 - textsz.y) / 2; @@ -160,19 +166,14 @@ class SWTPlotRenderer extends AbstractPlotRenderer<SWTLane, Color> { g.fillRoundRectangle(cellX + x + 1, cellY + texty -1, textsz.x + 3, textsz.y + 1, arc, arc); g.setForeground(sys_black); - // highlight checked out branch - Font oldFont = g.getFont(); - boolean isHead = isHead(name); - if (isHead) - g.setFont(CommitGraphTable.highlightFont()); - + // Draw text g.drawString(txt,cellX + x + 2, cellY + texty, true); if (isHead) g.setFont(oldFont); g.setLineWidth(2); - // And a two color shaded border, blend with whatever background there already is + // Add a two color shaded border, blend with whatever background there already is g.setAlpha(128); g.setForeground(sys_gray); g.drawRoundRectangle(cellX + x, cellY + texty -2, textsz.x + 5, textsz.y + 3, arc, arc); |