From 2c0553f8fd1df06058124957238f05db03fb4846 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 14 Nov 2023 23:04:45 +0100 Subject: [PATCH] impr: Don't wrap centered text anymore --- lib/libimhex/include/hex/ui/imgui_imhex_extensions.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h index 012329ed1..3cf92abad 100644 --- a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h +++ b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h @@ -231,25 +231,21 @@ namespace ImGui { inline void TextFormattedCentered(const std::string &fmt, auto &&...args) { auto text = hex::format(fmt, std::forward(args)...); auto availableSpace = ImGui::GetContentRegionAvail(); - auto textSize = ImGui::CalcTextSize(text.c_str(), nullptr, false, availableSpace.x * 0.75F); + auto textSize = ImGui::CalcTextSize(text.c_str(), nullptr, false); ImGui::SetCursorPos(((availableSpace - textSize) / 2.0F)); - ImGui::PushTextWrapPos(availableSpace.x * 0.75F); - ImGui::TextFormattedWrapped("{}", text); - ImGui::PopTextWrapPos(); + ImGui::TextFormatted("{}", text); } inline void TextFormattedCenteredHorizontal(const std::string &fmt, auto &&...args) { auto text = hex::format(fmt, std::forward(args)...); auto availableSpace = ImGui::GetContentRegionAvail(); - auto textSize = ImGui::CalcTextSize(text.c_str(), nullptr, false, availableSpace.x * 0.75F); + auto textSize = ImGui::CalcTextSize(text.c_str(), nullptr, false); ImGui::SetCursorPosX(((availableSpace - textSize) / 2.0F).x); - ImGui::PushTextWrapPos(availableSpace.x * 0.75F); ImGui::TextFormattedWrapped("{}", text); - ImGui::PopTextWrapPos(); } bool InputText(const char* label, std::string &buffer, ImGuiInputTextFlags flags = ImGuiInputTextFlags_None);