TextWrapped, PushTextWrapPos(0.0f) within a window with horizontal scrolling from not covering the full horizontal area (previously only worked with an explicit contents size).

This commit is contained in:
omar
2019-06-03 17:07:43 +02:00
parent fe32fde376
commit d6df777ff2
2 changed files with 7 additions and 1 deletions

View File

@ -2997,7 +2997,7 @@ float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
ImGuiWindow* window = GImGui->CurrentWindow;
if (wrap_pos_x == 0.0f)
wrap_pos_x = GetContentRegionMaxAbs().x;
wrap_pos_x = window->WorkRect.Max.x;
else if (wrap_pos_x > 0.0f)
wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space