From 12526fa75434f16411d373b194c41d3280dd32ab Mon Sep 17 00:00:00 2001 From: quaK <38787176+Joelrau@users.noreply.github.com> Date: Wed, 1 Jun 2022 15:04:04 +0300 Subject: [PATCH] Fix blurry text in game console --- src/client/component/game_console.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index 85b15eeb..4cddb7f3 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -293,13 +293,13 @@ namespace game_console if (dvar) { - const auto offset = (con.screen_max[0] - con.globals.x) / 4.f; + const auto offset_value = floor((con.screen_max[0] - con.globals.x) / 4.f); draw_hint_text(0, game::Dvar_ValueToString(dvar, dvar->current), - dvars::con_inputDvarValueColor->current.vector, offset); + dvars::con_inputDvarValueColor->current.vector, offset_value); draw_hint_text(1, " default", dvars::con_inputDvarInactiveValueColor->current.vector); draw_hint_text(1, game::Dvar_ValueToString(dvar, dvar->reset), - dvars::con_inputDvarInactiveValueColor->current.vector, offset); + dvars::con_inputDvarInactiveValueColor->current.vector, offset_value); draw_hint_text(2, dvars::dvar_get_description(dvar).data(), color_white, 0); @@ -320,7 +320,8 @@ namespace game_console { draw_hint_box(static_cast(matches.size()), dvars::con_inputHintBoxColor->current.vector); - const auto offset = (con.screen_max[0] - con.globals.x) / 4.f; + const auto offset_value = floor((con.screen_max[0] - con.globals.x) / 4.f); + const auto offset_description = floor((con.screen_max[0] - con.globals.x) / 2.5f); for (size_t i = 0; i < matches.size(); i++) { @@ -334,10 +335,10 @@ namespace game_console if (dvar) { draw_hint_text(static_cast(i), game::Dvar_ValueToString(dvar, dvar->current), - dvars::con_inputDvarValueColor->current.vector, offset); + dvars::con_inputDvarValueColor->current.vector, offset_value); draw_hint_text(static_cast(i), dvars::dvar_get_description(dvar).data(), - dvars::con_inputDvarValueColor->current.vector, offset * 1.5f); + dvars::con_inputDvarValueColor->current.vector, offset_description); } }