@@ -2774,70 +2774,27 @@ void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFl
2774
2774
//-----------------------------------------------------------------------------
2775
2775
2776
2776
// ImGuiWindow is mostly a dumb struct. It merely has a constructor and a few helper methods
2777
- ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
2778
- : DrawListInst(&context->DrawListSharedData)
2777
+ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name) : DrawListInst(NULL)
2779
2778
{
2779
+ memset(this, 0, sizeof(*this));
2780
2780
Name = ImStrdup(name);
2781
+ NameBufLen = (int)strlen(name) + 1;
2781
2782
ID = ImHashStr(name);
2782
2783
IDStack.push_back(ID);
2783
- Flags = ImGuiWindowFlags_None;
2784
- Pos = ImVec2(0.0f, 0.0f);
2785
- Size = SizeFull = ImVec2(0.0f, 0.0f);
2786
- ContentSize = ContentSizeExplicit = ImVec2(0.0f, 0.0f);
2787
- WindowPadding = ImVec2(0.0f, 0.0f);
2788
- WindowRounding = 0.0f;
2789
- WindowBorderSize = 0.0f;
2790
- NameBufLen = (int)strlen(name) + 1;
2791
2784
MoveId = GetID("#MOVE");
2792
- ChildId = 0;
2793
- Scroll = ImVec2(0.0f, 0.0f);
2794
2785
ScrollTarget = ImVec2(FLT_MAX, FLT_MAX);
2795
2786
ScrollTargetCenterRatio = ImVec2(0.5f, 0.5f);
2796
- ScrollbarSizes = ImVec2(0.0f, 0.0f);
2797
- ScrollbarX = ScrollbarY = false;
2798
- Active = WasActive = false;
2799
- WriteAccessed = false;
2800
- Collapsed = false;
2801
- WantCollapseToggle = false;
2802
- SkipItems = false;
2803
- Appearing = false;
2804
- Hidden = false;
2805
- IsFallbackWindow = false;
2806
- HasCloseButton = false;
2807
- ResizeBorderHeld = -1;
2808
- BeginCount = 0;
2809
- BeginOrderWithinParent = -1;
2810
- BeginOrderWithinContext = -1;
2811
- PopupId = 0;
2812
2787
AutoFitFramesX = AutoFitFramesY = -1;
2813
- AutoFitChildAxises = 0x00;
2814
- AutoFitOnlyGrows = false;
2815
2788
AutoPosLastDirection = ImGuiDir_None;
2816
- HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0;
2817
2789
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
2818
2790
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
2819
-
2820
- InnerRect = ImRect(0.0f, 0.0f, 0.0f, 0.0f); // Clear so the InnerRect.GetSize() code in Begin() doesn't lead to overflow even if the result isn't used.
2821
-
2822
2791
LastFrameActive = -1;
2823
2792
LastTimeActive = -1.0f;
2824
- ItemWidthDefault = 0.0f;
2825
2793
FontWindowScale = 1.0f;
2826
2794
SettingsOffset = -1;
2827
-
2828
2795
DrawList = &DrawListInst;
2796
+ DrawList->_Data = &context->DrawListSharedData;
2829
2797
DrawList->_OwnerName = Name;
2830
- ParentWindow = NULL;
2831
- RootWindow = NULL;
2832
- RootWindowForTitleBarHighlight = NULL;
2833
- RootWindowForNav = NULL;
2834
-
2835
- NavLastIds[0] = NavLastIds[1] = 0;
2836
- NavRectRel[0] = NavRectRel[1] = ImRect();
2837
- NavLastChildNavWindow = NULL;
2838
-
2839
- MemoryCompacted = false;
2840
- MemoryDrawListIdxCapacity = MemoryDrawListVtxCapacity = 0;
2841
2798
}
2842
2799
2843
2800
ImGuiWindow::~ImGuiWindow()
0 commit comments