|
|
@@ -5691,14 +5691,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.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:
|
|
|
// - 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
|
|
|
// (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.)
|
|
|
@@ -6601,7 +6601,7 @@ ImVec2 ImGui::GetContentRegionMax()
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
- ImVec2 mx = window->ContentsRegionRect.Max - window->Pos;
|
|
|
+ ImVec2 mx = window->ContentRegionRect.Max - window->Pos;
|
|
|
if (window->DC.CurrentColumns)
|
|
|
mx.x = window->WorkRect.Max.x - window->Pos.x;
|
|
|
return mx;
|
|
|
@@ -6612,7 +6612,7 @@ ImVec2 ImGui::GetContentRegionMaxAbs()
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* window = g.CurrentWindow;
|
|
|
- ImVec2 mx = window->ContentsRegionRect.Max;
|
|
|
+ ImVec2 mx = window->ContentRegionRect.Max;
|
|
|
if (window->DC.CurrentColumns)
|
|
|
mx.x = window->WorkRect.Max.x;
|
|
|
return mx;
|
|
|
@@ -6628,19 +6628,19 @@ ImVec2 ImGui::GetContentRegionAvail()
|
|
|
ImVec2 ImGui::GetWindowContentRegionMin()
|
|
|
{
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
|
- return window->ContentsRegionRect.Min - window->Pos;
|
|
|
+ return window->ContentRegionRect.Min - window->Pos;
|
|
|
}
|
|
|
|
|
|
ImVec2 ImGui::GetWindowContentRegionMax()
|
|
|
{
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
|
- return window->ContentsRegionRect.Max - window->Pos;
|
|
|
+ return window->ContentRegionRect.Max - window->Pos;
|
|
|
}
|
|
|
|
|
|
float ImGui::GetWindowContentRegionWidth()
|
|
|
{
|
|
|
ImGuiWindow* window = GImGui->CurrentWindow;
|
|
|
- return window->ContentsRegionRect.GetWidth();
|
|
|
+ return window->ContentRegionRect.GetWidth();
|
|
|
}
|
|
|
|
|
|
float ImGui::GetTextLineHeight()
|
|
|
@@ -9596,8 +9596,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
}
|
|
|
|
|
|
// 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 int show_windows_rect_type = WRT_WorkRect;
|
|
|
static bool show_windows_begin_order = false;
|
|
|
@@ -9628,8 +9628,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
else if (rect_type == WRT_InnerRect) { return window->InnerRect; }
|
|
|
else if (rect_type == WRT_InnerClipRect) { return window->InnerClipRect; }
|
|
|
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);
|
|
|
return ImRect();
|
|
|
}
|
|
|
@@ -9764,7 +9764,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
NodeColumns(&window->ColumnsStorage[n]);
|
|
|
ImGui::TreePop();
|
|
|
}
|
|
|
- ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.size_in_bytes());
|
|
|
+ NodeStorage(&window->StateStorage, "Storage");
|
|
|
ImGui::TreePop();
|
|
|
}
|
|
|
|
|
|
@@ -9789,6 +9789,18 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
ImGui::TreePop();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ static void NodeStorage(ImGuiStorage* storage, const char* label)
|
|
|
+ {
|
|
|
+ if (!ImGui::TreeNode(label, "%s: %d entries, %d bytes", label, storage->Data.Size, storage->Data.size_in_bytes()))
|
|
|
+ return;
|
|
|
+ for (int n = 0; n < storage->Data.Size; n++)
|
|
|
+ {
|
|
|
+ const ImGuiStorage::ImGuiStoragePair& p = storage->Data[n];
|
|
|
+ ImGui::BulletText("Key 0x%08X Value { i: %d }", p.key, p.val_i); // Important: we currently don't store a type, real value may not be integer.
|
|
|
+ }
|
|
|
+ ImGui::TreePop();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
Funcs::NodeWindows(g.Windows, "Windows");
|