Use GetContentRegionAvail().x

This commit is contained in:
Webster Sheets 2021-06-21 12:54:04 -04:00 committed by Drezil
parent 2d3aa2e52c
commit bbed1c4bbb

View File

@ -1085,7 +1085,7 @@ static void ShowDemoWindowWidgets()
ImGui::SameLine(); HelpMarker("Use SetCursorPos and TextWrapPos to horizontally align text blocks.");
ImGui::PushTextAlignment(text_align);
float max_wrap_width = ImGui::GetContentRegionAvailWidth();
float max_wrap_width = ImGui::GetContentRegionAvail().x;
if (wrap_width < max_wrap_width) {
ImGui::SetCursorPos(ImVec2(ImGui::GetCursorPosX() + fabs(max_wrap_width - wrap_width) * text_align, ImGui::GetCursorPosY()));
}