Keep the relative order of equal entries in sort_palette()

This commit is contained in:
David Capello 2015-07-14 07:47:22 -03:00
parent cdc7ab32fc
commit af9d5c917f

View File

@ -124,7 +124,7 @@ Remap sort_palette(Palette* palette, SortPaletteBy channel, bool ascending)
tmp[i].color = palette->getEntry(i);
}
std::sort(tmp.begin(), tmp.end(), PalEntryWithIndexPredicate(channel, ascending));
std::stable_sort(tmp.begin(), tmp.end(), PalEntryWithIndexPredicate(channel, ascending));
Remap remap(palette->size());
for (int i=0; i<palette->size(); ++i)