ImDrawData: fixed late initialized field. (Amend 6f41d13)

Would effectively be initialized on use but best to clear on constructor.
This commit is contained in:
ocornut
2026-07-23 17:55:43 +02:00
parent f594633b54
commit f31f98f4cd
2 changed files with 2 additions and 2 deletions

View File

@@ -3495,7 +3495,7 @@ struct ImDrawList
struct ImDrawData
{
bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
int FrameCount; // Frame counter of the emitter context. For debugging purpose.
int FrameCount; // Frame counter of the emitter context. Mostly for debugging purpose.
int TotalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
int TotalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
ImVector<ImDrawList*> CmdLists; // Array of ImDrawList* to render. The ImDrawLists are owned by ImGuiContext and only pointed to from here.

View File

@@ -2280,7 +2280,7 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
void ImDrawData::Clear()
{
Valid = false;
TotalIdxCount = TotalVtxCount = 0;
FrameCount = TotalIdxCount = TotalVtxCount = 0;
CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them.
DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f);
OwnerViewport = NULL;