From ff7a04187cc51c233442ae2a404b817a9a3d0d8f Mon Sep 17 00:00:00 2001 From: 4DBug Date: Sat, 24 Oct 2026 04:39:56 -0500 Subject: [PATCH] Tables: @native TableUpdateLayout(), TableSetupDrawChannels(), TableSetupColumnFlags() (once per table per frame, the largest interpreted cost of table-heavy windows: demo_all -2.5% instructions; +176 KB native code, paid for by the stb_truetype trim; draw data identical) --- imgui_tables.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui_tables.lua b/imgui_tables.lua index fe0b435..2eee46d 100644 --- a/imgui_tables.lua +++ b/imgui_tables.lua @@ -934,6 +934,7 @@ function ImGui.TableQueueSetColumnDisplayOrder(table_, column_n, dst_order) end -- Adjust flags: default width mode + stretch columns are not allowed when auto extending +@native local function TableSetupColumnFlags(table_, column, column_n, flags_in) local flags = flags_in @@ -993,6 +994,7 @@ end -- Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() and other TableSetupXXXXX() functions to be called first. -- FIXME-TABLE: Our width (and therefore our WorkRect) will be minimal in the first frame for _WidthAuto columns. -- Increase feedback side-effect with widgets relying on WorkRect.Max.x... Maybe provide a default distribution for _WidthAuto columns? +@native function ImGui.TableUpdateLayout(table_) local g = GImGui local temp_data = table_.TempData @@ -2961,6 +2963,7 @@ end -- - FreezeRows --> 2+D+N*2 (unless scrolling value is zero) -- - FreezeRows || FreezeColumns --> 3+D+N*2 (unless scrolling value is zero) -- Where D is 1 if any column is clipped or hidden (dummy channel) otherwise 0. +@native function ImGui.TableSetupDrawChannels(table_) local freeze_row_multiplier = (table_.FreezeRowsCount > 0) and 2 or 1 local channels_for_row = (band(table_.Flags, ImGuiTableFlags.NoClip) ~= 0) and 1 or table_.ColumnsEnabledCount