@@ -2774,70 +2774,27 @@ void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFl
27742774//-----------------------------------------------------------------------------
27752775
27762776// 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)
27792778{
2779+ memset(this, 0, sizeof(*this));
27802780 Name = ImStrdup(name);
2781+ NameBufLen = (int)strlen(name) + 1;
27812782 ID = ImHashStr(name);
27822783 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;
27912784 MoveId = GetID("#MOVE");
2792- ChildId = 0;
2793- Scroll = ImVec2(0.0f, 0.0f);
27942785 ScrollTarget = ImVec2(FLT_MAX, FLT_MAX);
27952786 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;
28122787 AutoFitFramesX = AutoFitFramesY = -1;
2813- AutoFitChildAxises = 0x00;
2814- AutoFitOnlyGrows = false;
28152788 AutoPosLastDirection = ImGuiDir_None;
2816- HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0;
28172789 SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
28182790 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-
28222791 LastFrameActive = -1;
28232792 LastTimeActive = -1.0f;
2824- ItemWidthDefault = 0.0f;
28252793 FontWindowScale = 1.0f;
28262794 SettingsOffset = -1;
2827-
28282795 DrawList = &DrawListInst;
2796+ DrawList->_Data = &context->DrawListSharedData;
28292797 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;
28412798}
28422799
28432800ImGuiWindow::~ImGuiWindow()
0 commit comments