@Override
protected void drawText(final String msg, final int x, final int y) {
final int texth = g.getFontMetrics().getHeight();
- final int y0 = y - texth/2 + (cell.getHeight() - texth)/2;
+ final int y0 = (y - texth) / 2 + (cell.getHeight() - texth) / 2;
g.setColor(cell.getForeground());
g.drawString(msg, x, y0 + texth - g.getFontMetrics().getDescent());
}
}
final String msg = commit.getShortMessage();
- drawText(msg, textx + dotSize, h / 2);
+ drawText(msg, textx + dotSize, h);
}
/**
* first pixel from the left that the text can be drawn at.
* Character data must not appear before this position.
* @param y
- * pixel coordinate of the centerline of the text.
- * Implementations must adjust this coordinate to account for the
- * way their implementation handles font rendering.
+ * pixel coordinate of the baseline of the text. Implementations
+ * must adjust this coordinate to account for the way their
+ * implementation handles font rendering.
*/
protected abstract void drawText(String msg, int x, int y);