Skip to content

Commit

Permalink
Add " fps" after the number of FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastiaanHolthuis authored and Adam- committed May 15, 2018
1 parent b61b77a commit 3a1e7ed
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class FpsOverlay extends Overlay
private static final int FPS_SIZE = MAX_FPS + 1;
private static final int Y_OFFSET = 14;
private static final int VALUE_X_OFFSET = 15;
private static final String FPS_STRING = " FPS";

// Cache of FPS number strings from 00-50
private final String[] fpsNums;
Expand Down Expand Up @@ -111,9 +112,8 @@ public Dimension render(Graphics2D graphics)
if (fps < FPS_SIZE)
{
final int width = client.getCanvas().getWidth();
final Point point = new Point(width - VALUE_X_OFFSET, Y_OFFSET);

OverlayUtil.renderTextLocation(graphics, point, fpsNums[fps], getFpsValueColor());
final Point point = new Point(width - VALUE_X_OFFSET - graphics.getFontMetrics().stringWidth(FPS_STRING), Y_OFFSET);
OverlayUtil.renderTextLocation(graphics, point, fpsNums[fps] + FPS_STRING, getFpsValueColor());
}

return null;
Expand Down

0 comments on commit 3a1e7ed

Please sign in to comment.