|
|
@ -50,10 +50,10 @@ public class TextView implements Drawable |
|
|
|
{ |
|
|
|
FontMetrics fontMetrics = g.getFontMetrics(); |
|
|
|
int x = position.x; |
|
|
|
int y = position.y + fontMetrics.getHeight(); |
|
|
|
int y = position.y + fontMetrics.getHeight() / 2; |
|
|
|
|
|
|
|
if (anchor == AnchorType.Center) |
|
|
|
x -= fontMetrics.stringWidth(text); |
|
|
|
x -= fontMetrics.stringWidth(text) / 2; |
|
|
|
else if (anchor == AnchorType.Right) |
|
|
|
x -= fontMetrics.stringWidth(text); |
|
|
|
|
|
|
|