diff --git a/modules/material_maker/editor/widgets/gradient_editor/gradient_editor.cpp b/modules/material_maker/editor/widgets/gradient_editor/gradient_editor.cpp index f372fb590..a019c6229 100644 --- a/modules/material_maker/editor/widgets/gradient_editor/gradient_editor.cpp +++ b/modules/material_maker/editor/widgets/gradient_editor/gradient_editor.cpp @@ -201,6 +201,10 @@ void MMGradientEditor::select_color(GradientCursor *cursor, const Vector2 &posit // Calculating a color from the gradient and generating the shader; +struct GradientCursorCustomSorter { + _FORCE_INLINE_ bool operator()(const GradientCursor *a, const GradientCursor *b) const { return a->operator<(*b); } +}; + Vector MMGradientEditor::get_sorted_cursors() { Vector array; @@ -212,7 +216,7 @@ Vector MMGradientEditor::get_sorted_cursors() { } } - array.sort(); + array.sort_custom(); return array; }