[TextServer] Fix glyph comparator ambiguous output, causing "bad comparison function" error spam when processing text with excessive use of combining diacritics.

This commit is contained in:
bruvzg 2023-10-30 18:38:37 +02:00
parent 93cdacbb0a
commit f52559bf98
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -681,11 +681,7 @@ class TextServerAdvanced : public TextServerExtension {
_FORCE_INLINE_ bool operator()(const Glyph &l, const Glyph &r) const {
if (l.start == r.start) {
if (l.count == r.count) {
if ((l.flags & TextServer::GRAPHEME_IS_VIRTUAL) == TextServer::GRAPHEME_IS_VIRTUAL) {
return false;
} else {
return true;
}
return (l.flags & TextServer::GRAPHEME_IS_VIRTUAL) < (r.flags & TextServer::GRAPHEME_IS_VIRTUAL);
}
return l.count > r.count; // Sort first glyph with count & flags, order of the rest are irrelevant.
} else {