Skip to content

Commit 60e8e64

Browse files
committed
(#106) remove translation from setMetrics
1 parent 7ab3f01 commit 60e8e64

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/tech/fastj/graphics/game/Text2D.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import tech.fastj.engine.FastJEngine;
44
import tech.fastj.math.Pointf;
5+
import tech.fastj.math.Transform2D;
56
import tech.fastj.graphics.Drawable;
67

78
import tech.fastj.systems.control.Scene;
@@ -205,8 +206,12 @@ private void setMetrics(Graphics2D g) {
205206
int textWidth = fm.stringWidth(text);
206207
int textHeight = fm.getHeight();
207208

208-
Pointf translation = getTranslation();
209-
final Rectangle2D.Float bounds = new Rectangle2D.Float(translation.x, translation.y, textWidth, textHeight);
209+
final Rectangle2D.Float bounds = new Rectangle2D.Float(
210+
Transform2D.DefaultTranslation.x,
211+
Transform2D.DefaultTranslation.y,
212+
textWidth,
213+
textHeight
214+
);
210215

211216
setCollisionPath(createMetricsPath(bounds));
212217

0 commit comments

Comments
 (0)