mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 16:29:54 +02:00
Tables: removed hot RequestOutputMaskByIndex bit-array as majority of code-paths are already touching the cold parts.
Only exception being TableSetColumnIndex() with same column number but that's an odd case. Will break PR #6094 #3572 #5305 #4876 but those not need to be necessarily updated: we got enough reference to finish that feature.
This commit is contained in:
@ -860,7 +860,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!)
|
||||
if (column->AutoFitQueue != 0x00)
|
||||
column->WidthRequest = width_auto;
|
||||
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)))
|
||||
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && column->IsRequestOutput)
|
||||
column->WidthRequest = width_auto;
|
||||
|
||||
// FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets
|
||||
@ -967,7 +967,6 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
ImRect host_clip_rect = table->InnerClipRect;
|
||||
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
|
||||
table->VisibleMaskByIndex = 0x00;
|
||||
table->RequestOutputMaskByIndex = 0x00;
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
{
|
||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||
@ -1041,8 +1040,6 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
|
||||
// Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output.
|
||||
column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0;
|
||||
if (column->IsRequestOutput)
|
||||
table->RequestOutputMaskByIndex |= ((ImU64)1 << column_n);
|
||||
|
||||
// Mark column as SkipItems (ignoring all items/layout)
|
||||
column->IsSkipItems = !column->IsEnabled || table->HostSkipItems;
|
||||
@ -1926,7 +1923,7 @@ bool ImGui::TableSetColumnIndex(int column_n)
|
||||
|
||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
||||
return table->Columns[column_n].IsRequestOutput;
|
||||
}
|
||||
|
||||
// [Public] Append into the next column, wrap and create a new row when already on last column
|
||||
@ -1951,8 +1948,7 @@ bool ImGui::TableNextColumn()
|
||||
|
||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||
int column_n = table->CurrentColumn;
|
||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
||||
return table->Columns[table->CurrentColumn].IsRequestOutput;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user