|
@@ -5689,14 +5689,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x;
|
|
window->WorkRect.Max.x = window->WorkRect.Min.x + work_rect_size_x;
|
|
window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y;
|
|
window->WorkRect.Max.y = window->WorkRect.Min.y + work_rect_size_y;
|
|
|
|
|
|
- // [LEGACY] Contents Region
|
|
|
|
- // FIXME-OBSOLETE: window->ContentsRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it.
|
|
|
|
|
|
+ // [LEGACY] Content Region
|
|
|
|
+ // FIXME-OBSOLETE: window->ContentRegionRect.Max is currently very misleading / partly faulty, but some BeginChild() patterns relies on it.
|
|
// Used by:
|
|
// Used by:
|
|
// - Mouse wheel scrolling + many other things
|
|
// - Mouse wheel scrolling + many other things
|
|
- window->ContentsRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x;
|
|
|
|
- window->ContentsRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height;
|
|
|
|
- window->ContentsRegionRect.Max.x = window->ContentsRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
|
|
|
|
- window->ContentsRegionRect.Max.y = window->ContentsRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
|
|
|
|
|
|
+ window->ContentRegionRect.Min.x = window->Pos.x - window->Scroll.x + window->WindowPadding.x;
|
|
|
|
+ window->ContentRegionRect.Min.y = window->Pos.y - window->Scroll.y + window->WindowPadding.y + decoration_up_height;
|
|
|
|
+ window->ContentRegionRect.Max.x = window->ContentRegionRect.Min.x + (window->ContentSizeExplicit.x != 0.0f ? window->ContentSizeExplicit.x : (window->Size.x - window->WindowPadding.x * 2.0f - window->ScrollbarSizes.x));
|
|
|
|
+ window->ContentRegionRect.Max.y = window->ContentRegionRect.Min.y + (window->ContentSizeExplicit.y != 0.0f ? window->ContentSizeExplicit.y : (window->Size.y - window->WindowPadding.y * 2.0f - decoration_up_height - window->ScrollbarSizes.y));
|
|
|
|
|
|
// Setup drawing context
|
|
// Setup drawing context
|
|
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
|
|
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
|
|
@@ -6599,7 +6599,7 @@ ImVec2 ImGui::GetContentRegionMax()
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
- ImVec2 mx = window->ContentsRegionRect.Max - window->Pos;
|
|
|
|
|
|
+ ImVec2 mx = window->ContentRegionRect.Max - window->Pos;
|
|
if (window->DC.CurrentColumns)
|
|
if (window->DC.CurrentColumns)
|
|
mx.x = window->WorkRect.Max.x - window->Pos.x;
|
|
mx.x = window->WorkRect.Max.x - window->Pos.x;
|
|
return mx;
|
|
return mx;
|
|
@@ -6610,7 +6610,7 @@ ImVec2 ImGui::GetContentRegionMaxAbs()
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
- ImVec2 mx = window->ContentsRegionRect.Max;
|
|
|
|
|
|
+ ImVec2 mx = window->ContentRegionRect.Max;
|
|
if (window->DC.CurrentColumns)
|
|
if (window->DC.CurrentColumns)
|
|
mx.x = window->WorkRect.Max.x;
|
|
mx.x = window->WorkRect.Max.x;
|
|
return mx;
|
|
return mx;
|
|
@@ -6626,19 +6626,19 @@ ImVec2 ImGui::GetContentRegionAvail()
|
|
ImVec2 ImGui::GetWindowContentRegionMin()
|
|
ImVec2 ImGui::GetWindowContentRegionMin()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
- return window->ContentsRegionRect.Min - window->Pos;
|
|
|
|
|
|
+ return window->ContentRegionRect.Min - window->Pos;
|
|
}
|
|
}
|
|
|
|
|
|
ImVec2 ImGui::GetWindowContentRegionMax()
|
|
ImVec2 ImGui::GetWindowContentRegionMax()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
- return window->ContentsRegionRect.Max - window->Pos;
|
|
|
|
|
|
+ return window->ContentRegionRect.Max - window->Pos;
|
|
}
|
|
}
|
|
|
|
|
|
float ImGui::GetWindowContentRegionWidth()
|
|
float ImGui::GetWindowContentRegionWidth()
|
|
{
|
|
{
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
- return window->ContentsRegionRect.GetWidth();
|
|
|
|
|
|
+ return window->ContentRegionRect.GetWidth();
|
|
}
|
|
}
|
|
|
|
|
|
float ImGui::GetTextLineHeight()
|
|
float ImGui::GetTextLineHeight()
|
|
@@ -9594,8 +9594,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
}
|
|
}
|
|
|
|
|
|
// State
|
|
// State
|
|
- enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Contents, WRT_ContentsRegionRect, WRT_Count }; // Windows Rect Type
|
|
|
|
- const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Contents", "ContentsRegionRect" };
|
|
|
|
|
|
+ enum { WRT_OuterRect, WRT_OuterRectClipped, WRT_InnerRect, WRT_InnerClipRect, WRT_WorkRect, WRT_Content, WRT_ContentRegionRect, WRT_Count }; // Windows Rect Type
|
|
|
|
+ const char* wrt_rects_names[WRT_Count] = { "OuterRect", "OuterRectClipped", "InnerRect", "InnerClipRect", "WorkRect", "Content", "ContentRegionRect" };
|
|
static bool show_windows_rects = false;
|
|
static bool show_windows_rects = false;
|
|
static int show_windows_rect_type = WRT_WorkRect;
|
|
static int show_windows_rect_type = WRT_WorkRect;
|
|
static bool show_windows_begin_order = false;
|
|
static bool show_windows_begin_order = false;
|
|
@@ -9626,8 +9626,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
else if (rect_type == WRT_InnerRect) { return window->InnerRect; }
|
|
else if (rect_type == WRT_InnerRect) { return window->InnerRect; }
|
|
else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; }
|
|
else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; }
|
|
else if (rect_type == WRT_WorkRect) { return window->WorkRect; }
|
|
else if (rect_type == WRT_WorkRect) { return window->WorkRect; }
|
|
- else if (rect_type == WRT_Contents) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
|
|
|
|
- else if (rect_type == WRT_ContentsRegionRect) { return window->ContentsRegionRect; }
|
|
|
|
|
|
+ else if (rect_type == WRT_Content) { ImVec2 min = window->InnerRect.Min - window->Scroll + window->WindowPadding; return ImRect(min, min + window->ContentSize); }
|
|
|
|
+ else if (rect_type == WRT_ContentRegionRect) { return window->ContentRegionRect; }
|
|
IM_ASSERT(0);
|
|
IM_ASSERT(0);
|
|
return ImRect();
|
|
return ImRect();
|
|
}
|
|
}
|