diff --git a/imgui.cpp b/imgui.cpp index e28b993..bd62822 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10979,6 +10979,7 @@ window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX); // Initialize defaults + columns->IsFirstFrame = (columns->Columns.Size == 0); if (columns->Columns.Size == 0) { columns->Columns.reserve(columns_count + 1); @@ -11032,6 +11033,7 @@ window->DC.CursorMaxPos.x = ImMax(columns->StartMaxPosX, columns->MaxX); // Restore cursor max pos, as columns don't grow parent // Draw columns borders and handle resize + columns->IsBeingResized = false; if (!(columns->Flags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems) { const float y1 = columns->StartPosY; @@ -11070,6 +11072,7 @@ { float x = GetDraggedColumnOffset(columns, dragging_column); SetColumnOffset(dragging_column, x); + columns->IsBeingResized = true; } } diff --git a/imgui.cpp b/imgui.cpp index e28b993..bd62822 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10979,6 +10979,7 @@ window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX); // Initialize defaults + columns->IsFirstFrame = (columns->Columns.Size == 0); if (columns->Columns.Size == 0) { columns->Columns.reserve(columns_count + 1); @@ -11032,6 +11033,7 @@ window->DC.CursorMaxPos.x = ImMax(columns->StartMaxPosX, columns->MaxX); // Restore cursor max pos, as columns don't grow parent // Draw columns borders and handle resize + columns->IsBeingResized = false; if (!(columns->Flags & ImGuiColumnsFlags_NoBorder) && !window->SkipItems) { const float y1 = columns->StartPosY; @@ -11070,6 +11072,7 @@ { float x = GetDraggedColumnOffset(columns, dragging_column); SetColumnOffset(dragging_column, x); + columns->IsBeingResized = true; } } diff --git a/imgui_internal.h b/imgui_internal.h index f79f46b..ca1086b 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -424,6 +424,8 @@ { ImGuiID ID; ImGuiColumnsFlags Flags; + bool IsFirstFrame; + bool IsBeingResized; int Current; int Count; float MinX, MaxX; @@ -437,6 +439,8 @@ { ID = 0; Flags = 0; + IsFirstFrame = false; + IsBeingResized = false; Current = 0; Count = 1; MinX = MaxX = 0.0f;