From b9936a80eec793a0931496878aa1be5c07f3420c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 15 Mar 2025 15:13:16 -0500 Subject: [PATCH] fix red talk word hitbox --- src/gfx/render_text.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gfx/render_text.cpp b/src/gfx/render_text.cpp index 383729e1..f1495dbf 100644 --- a/src/gfx/render_text.cpp +++ b/src/gfx/render_text.cpp @@ -290,6 +290,10 @@ static void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,st str_to_draw.setPosition(snippet.at); if(snippet.hilited) { rectangle bounds = str_to_draw.getGlobalBounds(); + // Width and height are too large by ui_scale because scale-aware text exists in unscaled space: + bounds.width() /= get_ui_scale(); + bounds.height() /= get_ui_scale(); + // Adjust so that drawing the same text to // the same rect is positioned exactly right bounds.move_to(snippet.at);