|
@@ -2983,7 +2983,7 @@ float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
|
|
|
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
if (wrap_pos_x == 0.0f)
|
|
if (wrap_pos_x == 0.0f)
|
|
- wrap_pos_x = GetContentRegionMaxScreen().x;
|
|
|
|
|
|
+ wrap_pos_x = GetWorkRectMax().x;
|
|
else if (wrap_pos_x > 0.0f)
|
|
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
|
|
wrap_pos_x += window->Pos.x - window->Scroll.x; // wrap_pos_x is provided is window local space
|
|
|
|
|
|
@@ -5808,7 +5808,7 @@ float ImGui::GetNextItemWidth()
|
|
}
|
|
}
|
|
if (w < 0.0f)
|
|
if (w < 0.0f)
|
|
{
|
|
{
|
|
- float region_max_x = GetContentRegionMaxScreen().x;
|
|
|
|
|
|
+ float region_max_x = GetWorkRectMax().x;
|
|
w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w);
|
|
w = ImMax(1.0f, region_max_x - window->DC.CursorPos.x + w);
|
|
}
|
|
}
|
|
w = (float)(int)w;
|
|
w = (float)(int)w;
|
|
@@ -5836,7 +5836,7 @@ ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h)
|
|
|
|
|
|
ImVec2 region_max;
|
|
ImVec2 region_max;
|
|
if (size.x < 0.0f || size.y < 0.0f)
|
|
if (size.x < 0.0f || size.y < 0.0f)
|
|
- region_max = GetContentRegionMaxScreen();
|
|
|
|
|
|
+ region_max = GetWorkRectMax();
|
|
|
|
|
|
if (size.x == 0.0f)
|
|
if (size.x == 0.0f)
|
|
size.x = default_w;
|
|
size.x = default_w;
|
|
@@ -6424,7 +6424,7 @@ ImVec2 ImGui::GetContentRegionMax()
|
|
}
|
|
}
|
|
|
|
|
|
// [Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features.
|
|
// [Internal] Absolute coordinate. Saner. This is not exposed until we finishing refactoring work rect features.
|
|
-ImVec2 ImGui::GetContentRegionMaxScreen()
|
|
|
|
|
|
+ImVec2 ImGui::GetWorkRectMax()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImVec2 mx = window->ContentsRegionRect.Max;
|
|
ImVec2 mx = window->ContentsRegionRect.Max;
|
|
@@ -6436,7 +6436,7 @@ ImVec2 ImGui::GetContentRegionMaxScreen()
|
|
ImVec2 ImGui::GetContentRegionAvail()
|
|
ImVec2 ImGui::GetContentRegionAvail()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
- return GetContentRegionMaxScreen() - window->DC.CursorPos;
|
|
|
|
|
|
+ return GetWorkRectMax() - window->DC.CursorPos;
|
|
}
|
|
}
|
|
|
|
|
|
// In window space (not screen space!)
|
|
// In window space (not screen space!)
|