mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-24 04:37:00 +00:00
Use GetContentRegionAvail().x
This commit is contained in:
parent
2d3aa2e52c
commit
bbed1c4bbb
@ -1085,7 +1085,7 @@ static void ShowDemoWindowWidgets()
|
|||||||
ImGui::SameLine(); HelpMarker("Use SetCursorPos and TextWrapPos to horizontally align text blocks.");
|
ImGui::SameLine(); HelpMarker("Use SetCursorPos and TextWrapPos to horizontally align text blocks.");
|
||||||
ImGui::PushTextAlignment(text_align);
|
ImGui::PushTextAlignment(text_align);
|
||||||
|
|
||||||
float max_wrap_width = ImGui::GetContentRegionAvailWidth();
|
float max_wrap_width = ImGui::GetContentRegionAvail().x;
|
||||||
if (wrap_width < max_wrap_width) {
|
if (wrap_width < max_wrap_width) {
|
||||||
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + fabs(max_wrap_width - wrap_width) * text_align, ImGui::GetCursorPosY()));
|
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + fabs(max_wrap_width - wrap_width) * text_align, ImGui::GetCursorPosY()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user