From e12ebce572ff5dd624477bf5d3dff84242f2e175 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta <gunnar.sletta@digia.com> Date: Mon, 13 May 2013 16:02:30 +0200 Subject: [PATCH] Fix sorting of QSGTextMaskMaterial (native glyph drawing). It seems we were hitting the bool operator rather than the pointer values so all text materials, regardless of size or style would return equal. Change-Id: I8773e5aa965035f6737920747c2cf073929ff799 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> --- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 3df11532e4..f5a461f19e 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -521,7 +521,7 @@ int QSGTextMaskMaterial::compare(const QSGMaterial *o) const Q_ASSERT(o && type() == o->type()); const QSGTextMaskMaterial *other = static_cast<const QSGTextMaskMaterial *>(o); if (m_glyphCache != other->m_glyphCache) - return m_glyphCache - other->m_glyphCache; + return m_glyphCache.data() < other->m_glyphCache.data() ? -1 : 1; QRgb c1 = m_color.rgba(); QRgb c2 = other->m_color.rgba(); return int(c2 < c1) - int(c1 < c2); -- GitLab