fix red talk word hitbox

This commit is contained in:
2025-03-15 15:13:16 -05:00
committed by Celtic Minstrel
parent 079e3d721f
commit b9936a80ee

View File

@@ -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);