From 6e09878f546ae7f1ec90320f1dac1047c02298a2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 15 Jun 2022 17:22:58 +0200 Subject: [PATCH] Fix sorting GradientCursors. --- .../editor/widgets/gradient_editor/gradient_editor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }