Tables: Fix sort direction (issue 3023). Remove SortOrder from ImGuiTableSortSpecsColumn. Made sort arrow smaller. Added debug stuff in metrics.

This commit is contained in:
Omar
2020-02-17 15:09:50 +01:00
committed by ocornut
parent 643cf6fc8c
commit ae6fc48f60
3 changed files with 22 additions and 19 deletions

View File

@ -3271,10 +3271,10 @@ struct MyItem
case MyItemColumnID_Description: delta = (strcmp(a->Name, b->Name)); break;
default: IM_ASSERT(0); break;
}
if (delta < 0)
return -1 * sort_spec->SortSign;
if (delta > 0)
return +1 * sort_spec->SortSign;
return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? +1 : -1;
if (delta < 0)
return (sort_spec->SortDirection == ImGuiSortDirection_Ascending) ? -1 : +1;
}
// qsort() is instable so always return a way to differenciate items.