mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Internals: Rename GetContentRegionMaxScreen() -> GetWorkRectMax(). At this point this is mostly useful to facilitate merge of other branches.
This commit is contained in:
10
imgui.cpp
10
imgui.cpp
@ -2983,7 +2983,7 @@ float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
|
||||
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
if (wrap_pos_x == 0.0f)
|
||||
wrap_pos_x = GetContentRegionMaxScreen().x;
|
||||
wrap_pos_x = GetWorkRectMax().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
|
||||
|
||||
@ -5808,7 +5808,7 @@ float ImGui::GetNextItemWidth()
|
||||
}
|
||||
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 = (float)(int)w;
|
||||
@ -5836,7 +5836,7 @@ ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h)
|
||||
|
||||
ImVec2 region_max;
|
||||
if (size.x < 0.0f || size.y < 0.0f)
|
||||
region_max = GetContentRegionMaxScreen();
|
||||
region_max = GetWorkRectMax();
|
||||
|
||||
if (size.x == 0.0f)
|
||||
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.
|
||||
ImVec2 ImGui::GetContentRegionMaxScreen()
|
||||
ImVec2 ImGui::GetWorkRectMax()
|
||||
{
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
ImVec2 mx = window->ContentsRegionRect.Max;
|
||||
@ -6436,7 +6436,7 @@ ImVec2 ImGui::GetContentRegionMaxScreen()
|
||||
ImVec2 ImGui::GetContentRegionAvail()
|
||||
{
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
return GetContentRegionMaxScreen() - window->DC.CursorPos;
|
||||
return GetWorkRectMax() - window->DC.CursorPos;
|
||||
}
|
||||
|
||||
// In window space (not screen space!)
|
||||
|
Reference in New Issue
Block a user