From 4cf478605e9d90d0bfaeec1f8e78cfdc71be402b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 16 Aug 2014 13:50:50 +0200 Subject: Fix text rendering Since we don't save/restore the painter state for each node, we have to be careful that settings don't "leak" across paint calls. For example a rectangle node with a gradient will leave the painter with a brush set. A sub-sequent child text node will be rendered incorrectly. This patch corrects that by setting the brush explicitly to the empty brush. This fixes also the examples/quick/views rendering. Change-Id: Ia1415b5fdf77a560b02719917d36298e808418f1 Reviewed-by: Louai Al-Khanji Reviewed-by: Lars Knoll --- softwarecontext/glyphnode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/softwarecontext/glyphnode.cpp b/softwarecontext/glyphnode.cpp index 8099df03d9..eae8b626cb 100644 --- a/softwarecontext/glyphnode.cpp +++ b/softwarecontext/glyphnode.cpp @@ -64,6 +64,7 @@ void GlyphNode::update() void GlyphNode::paint(QPainter *painter) { + painter->setBrush(QBrush()); QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent()); switch (m_style) { -- cgit v1.2.3