Skip to content

Commit fbe74ed

Browse files
committed
Tab Bar: zero clear more structures.
1 parent 8c9b3c9 commit fbe74ed

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

imgui_internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ struct ImGuiTabItem
17401740
ImS16 IndexDuringLayout; // Index only used during TabBarLayout()
17411741
bool WantClose; // Marked as closed by SetTabItemClosed()
17421742

1743-
ImGuiTabItem() { ID = 0; Flags = ImGuiTabItemFlags_None; LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; Offset = Width = ContentWidth = 0.0f; BeginOrder = -1; IndexDuringLayout = -1; WantClose = false; }
1743+
ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; NameOffset = BeginOrder = IndexDuringLayout = -1; }
17441744
};
17451745

17461746
// Storage for a tab bar (sizeof() 152 bytes)

imgui_widgets.cpp

+1-12
Original file line numberDiff line numberDiff line change
@@ -6802,20 +6802,9 @@ namespace ImGui
68026802

68036803
ImGuiTabBar::ImGuiTabBar()
68046804
{
6805-
Flags = ImGuiTabBarFlags_None;
6806-
ID = 0;
6807-
SelectedTabId = NextSelectedTabId = VisibleTabId = 0;
6805+
memset(this, 0, sizeof(*this));
68086806
CurrFrameVisible = PrevFrameVisible = -1;
6809-
CurrTabsContentsHeight = PrevTabsContentsHeight = 0.0f;
6810-
WidthAllTabs = WidthAllTabsIdeal = 0.0f;
6811-
ScrollingAnim = ScrollingTarget = ScrollingTargetDistToVisibility = ScrollingSpeed = 0.0f;
6812-
ScrollingRectMinX = ScrollingRectMaxX = 0.0f;
6813-
ReorderRequestTabId = 0;
6814-
ReorderRequestDir = 0;
6815-
TabsActiveCount = 0;
68166807
LastTabItemIdx = -1;
6817-
BeginCount = 0;
6818-
WantLayout = VisibleTabWasSubmitted = TabsAddedNew = false;
68196808
}
68206809

68216810
static int IMGUI_CDECL TabItemComparerBySection(const void* lhs, const void* rhs)

0 commit comments

Comments
 (0)