diff --git a/src/doc/sort_palette.cpp b/src/doc/sort_palette.cpp index 985863e07..6039eedb9 100644 --- a/src/doc/sort_palette.cpp +++ b/src/doc/sort_palette.cpp @@ -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; isize(); ++i)