mirror of https://github.com/WerWolv/ImHex.git
impr: Don't wrap centered text anymore
This commit is contained in:
parent
13b72c8f93
commit
2c0553f8fd
|
@ -231,25 +231,21 @@ namespace ImGui {
|
|||
inline void TextFormattedCentered(const std::string &fmt, auto &&...args) {
|
||||
auto text = hex::format(fmt, std::forward<decltype(args)>(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<decltype(args)>(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);
|
||||
|
|
Loading…
Reference in New Issue