MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / TableGetMaxDisplayOrderAllowed

Function TableGetMaxDisplayOrderAllowed

include/imgui/imgui_tables.cpp:755–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753}
754
755static int TableGetMaxDisplayOrderAllowed(ImGuiTable* table, int src_order, int dst_order)
756{
757 dst_order = ImClamp(dst_order, 0, table->ColumnsCount - 1);
758 if (src_order == dst_order)
759 return dst_order;
760
761 // Cannot cross over the frozen column limit when interactively reordering.
762 // TableSetupScrollFreeze() enforce a display order range for frozen columns. Reordering across the frozen column barrier is illegal and will be undone.
763 if (table->FreezeColumnsRequest > 0)
764 dst_order = (src_order < table->FreezeColumnsRequest) ? ImMin(dst_order, (int)table->FreezeColumnsRequest - 1) : ImMax(dst_order, (int)table->FreezeColumnsRequest);
765
766 // Cannot cross over a column with the ImGuiTableColumnFlags_NoReorder flag.
767 int reorder_dir = (src_order < dst_order) ? +1 : -1;
768 for (int order_n = src_order; (src_order < dst_order && order_n <= dst_order) || (dst_order < src_order && order_n >= dst_order); order_n += reorder_dir)
769 if (table->Columns[table->DisplayOrderToIndex[order_n]].Flags & ImGuiTableColumnFlags_NoReorder)
770 {
771 dst_order = (order_n == src_order) ? src_order : order_n - reorder_dir;
772 break;
773 }
774 return dst_order;
775}
776
777// Reorder requested by user interaction.
778void ImGui::TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order)

Calls 3

ImClampFunction · 0.85
ImMinFunction · 0.85
ImMaxFunction · 0.85

Tested by

no test coverage detected