Skip to content

Commit ac6e272

Browse files
committed
Release v6.8: center print pivot scaling fix
1 parent 3f008f0 commit ac6e272

4 files changed

Lines changed: 7 additions & 21 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.7
1+
6.8

hdr/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
Increment version using: ./increment_version.sh
88
*/
99

10-
#define SOFBUDDY_VERSION "6.7"
10+
#define SOFBUDDY_VERSION "6.8"

src/features/scaled_ui_base/hooks/r_drawfont.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ void hkR_DrawFont(int screenX, int screenY, char * text, int colorPalette, char
7272
float s = fontScale;
7373
if (s <= 0.0f) s = 1.0f;
7474
if (s != 1.0f) {
75+
// screenX is line start; screenY is absolute line Y (not a pause-style inset).
7576
const float textW = static_cast<float>(current_vid_w - 2 * screenX);
76-
screenX -= static_cast<int>(snap_ui_pixel(textW * (s - 1.0f) * 0.5f));
77+
screenX -= static_cast<int>(textW * (s - 1.0f) * 0.5f);
7778
}
7879
}
7980

src/features/scaled_ui_base/text_scaling.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,10 @@ inline void handleFontVertex(float x, float y, bool scaleX, bool scaleY, bool in
135135
case FontCaller::SCR_DrawCenterPrint: {
136136
float s = fontScale;
137137
if (s <= 0.0f) s = 1.0f;
138-
if (s != 1.0f && g_centerPrintAnchorSeq == g_lastCenterPrintSeq &&
139-
g_lastCenterPrintLineCount > 0) {
140-
if (g_centerPrintScaleSeq != g_lastCenterPrintSeq) {
141-
float font_h = g_centerPrintLineStep;
142-
if (font_h <= 0.0f) font_h = static_cast<float>(realFontSizes[realFont]);
143-
if (font_h <= 0.0f) font_h = 8.0f;
144-
const float anchorY = (g_centerPrintAnchorY > 0.0f)
145-
? g_centerPrintAnchorY
146-
: static_cast<float>(current_vid_h) * 0.35f;
147-
computeTextBottomAnchor(anchorY, g_lastCenterPrintLineCount,
148-
font_h, g_centerPrintBottomY, g_centerPrintTargetBottomY);
149-
g_centerPrintScaleSeq = g_lastCenterPrintSeq;
150-
}
151-
// Match pause-screen X model (pivot + char advance); keep bottom-anchored Y.
138+
if (s != 1.0f) {
152139
if (scaleX) x = pivotx + (x - pivotx) * s;
153-
y = g_centerPrintTargetBottomY + (y - g_centerPrintBottomY) * s;
154-
orig_glVertex2f(
155-
snap_ui_pixel(x + (characterIndex * realFontSizes[realFont]) * (s - 1)),
156-
snap_ui_pixel(y));
140+
if (scaleY) y = pivoty + (y - pivoty) * s;
141+
orig_glVertex2f(x + (characterIndex * realFontSizes[realFont]) * (s - 1), y);
157142
} else {
158143
orig_glVertex2f(x, y);
159144
}

0 commit comments

Comments
 (0)