Skip to content

Commit 57cdb14

Browse files
committed
Use logical height to center text instead.
1 parent 3651a41 commit 57cdb14

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/src/main/java/oxy/bascenario/screens/renderer/dialogue/OptionsRenderer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ public void render(ScenarioScreen screen) {
9797
}
9898

9999
float textX = buttonX + (buttonWidth / 2) - (TextUtils.getVisualWidth(TEXT_SIZE, textRun.shape()) * textScale * scale) / 2;
100-
float textY = buttonY + (buttonHeight / 2) - (TextUtils.getVisualHeight(TEXT_SIZE, textRun.shape()) * textScale * scale) / 2;
100+
float textY = buttonY + (buttonHeight / 2) - (TextUtils.getLogicalHeight(TEXT_SIZE, textRun.shape()) * textScale * scale) / 2;
101101
GLOBAL_RENDER_STACK.pushMatrix();
102-
GLOBAL_RENDER_STACK.translate(textX + 7, textY, 0);
102+
GLOBAL_RENDER_STACK.translate(textX, textY, 0);
103103
GLOBAL_RENDER_STACK.scale(textScale);
104104
GLOBAL_RENDER_STACK.scale(scale);
105-
TextUtils.textRun(TEXT_SIZE, textRun, 0, 0, RendererText.VerticalOrigin.VISUAL_TOP, RendererText.HorizontalOrigin.VISUAL_LEFT);
105+
TextUtils.textRun(TEXT_SIZE, textRun, 0, 0, RendererText.VerticalOrigin.LOGICAL_TOP, RendererText.HorizontalOrigin.VISUAL_LEFT);
106106
GLOBAL_RENDER_STACK.popMatrix();
107107

108108
i++;

0 commit comments

Comments
 (0)