forked from I2P_Developers/i2p.i2p
Console: Tweak graph title placement
This commit is contained in:
@@ -264,8 +264,12 @@ public class RrdGraph implements RrdGraphConstants {
|
||||
if (!gdef.onlyGraph) {
|
||||
worker.setTextAntiAliasing(gdef.textAntiAliasing);
|
||||
if (gdef.title != null) {
|
||||
int x = im.xgif / 2 - (int) (worker.getStringWidth(gdef.title, gdef.getFont(FONTTAG_TITLE)) / 2);
|
||||
int y = PADDING_TOP + (int) worker.getFontAscent(gdef.getFont(FONTTAG_TITLE));
|
||||
// I2P truncate on the right only
|
||||
//int x = im.xgif / 2 - (int) (worker.getStringWidth(gdef.title, gdef.getFont(FONTTAG_TITLE)) / 2);
|
||||
int x = Math.max(2, im.xgif / 2 - (int) (worker.getStringWidth(gdef.title, gdef.getFont(FONTTAG_TITLE)) / 2));
|
||||
// I2P a little less padding on top and more on the bottom
|
||||
//int y = PADDING_TOP + (int) worker.getFontAscent(gdef.getFont(FONTTAG_TITLE));
|
||||
int y = PADDING_TOP * 2 / 3 + (int) worker.getFontAscent(gdef.getFont(FONTTAG_TITLE));
|
||||
worker.drawString(gdef.title, x, y, gdef.getFont(FONTTAG_TITLE), gdef.getColor(ElementsNames.font));
|
||||
}
|
||||
if (gdef.verticalLabel != null) {
|
||||
|
||||
Reference in New Issue
Block a user