From 35acf29a38d4b631dd27ce767466533223e8b2c4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 5 Jul 2019 13:08:21 +0200 Subject: Support text color for color fonts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to support pen color for color fonts, we have to bake the color into the cache (since the cache contains actual color data and not alpha values). This is equivalent of 78caba7ae637bf4b33631c3425eb92ec3946c99e in Qt Base. [ChangeLog][Text] Added support for text color when using color fonts. Task-number: QTBUG-74761 Change-Id: I5910636c240bd4c0ec3f0b13db4e2f78d4b062ff Reviewed-by: Tor Arne Vestbø --- src/quick/scenegraph/qsgdefaultglyphnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgdefaultglyphnode.cpp') diff --git a/src/quick/scenegraph/qsgdefaultglyphnode.cpp b/src/quick/scenegraph/qsgdefaultglyphnode.cpp index 0d42102f36..cae0eda3f4 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode.cpp @@ -75,7 +75,7 @@ void QSGDefaultGlyphNode::update() QMargins margins(0, 0, 0, 0); if (m_style == QQuickText::Normal) { - m_material = new QSGTextMaskMaterial(font); + m_material = new QSGTextMaskMaterial(QVector4D(m_color.redF(), m_color.greenF(), m_color.blueF(), m_color.alphaF()), font); } else if (m_style == QQuickText::Outline) { QSGOutlinedTextMaterial *material = new QSGOutlinedTextMaterial(font); material->setStyleColor(m_styleColor); -- cgit v1.2.3