diff options
Diffstat (limited to 'softwarecontext')
-rw-r--r-- | softwarecontext/glyphnode.cpp | 6 | ||||
-rw-r--r-- | softwarecontext/imagenode.cpp | 9 | ||||
-rw-r--r-- | softwarecontext/rectanglenode.cpp | 6 |
3 files changed, 2 insertions, 19 deletions
diff --git a/softwarecontext/glyphnode.cpp b/softwarecontext/glyphnode.cpp index ecb8b3f6dc..eae8b626cb 100644 --- a/softwarecontext/glyphnode.cpp +++ b/softwarecontext/glyphnode.cpp @@ -64,9 +64,6 @@ void GlyphNode::update() void GlyphNode::paint(QPainter *painter) { - QPen originalPen = painter->pen(); - QBrush originalBrush = painter->brush(); - painter->setBrush(QBrush()); QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent()); @@ -91,7 +88,4 @@ void GlyphNode::paint(QPainter *painter) painter->setPen(m_color); painter->drawGlyphRun(pos, m_glyphRun); - - painter->setPen(originalPen); - painter->setBrush(originalBrush); } diff --git a/softwarecontext/imagenode.cpp b/softwarecontext/imagenode.cpp index 519f5dc6f6..7718831b65 100644 --- a/softwarecontext/imagenode.cpp +++ b/softwarecontext/imagenode.cpp @@ -380,7 +380,6 @@ static Qt::TileRule getTileRule(qreal factor) void ImageNode::paint(QPainter *painter) { - QPainter::RenderHints originalHints = painter->renderHints(); painter->setRenderHint(QPainter::SmoothPixmapTransform, m_smooth); const QPixmap &pm = pixmap(); @@ -396,8 +395,7 @@ void ImageNode::paint(QPainter *painter) } if (m_tileHorizontal || m_tileVertical) { - QMatrix originalMatrix = painter->matrix(); - + painter->save(); qreal sx = m_targetRect.width()/(m_subSourceRect.width()*pm.width()); qreal sy = m_targetRect.height()/(m_subSourceRect.height()*pm.height()); QMatrix transform(sx, 0, 0, sy, 0, 0); @@ -405,15 +403,12 @@ void ImageNode::paint(QPainter *painter) painter->drawTiledPixmap(QRectF(m_targetRect.x()/sx, m_targetRect.y()/sy, m_targetRect.width()/sx, m_targetRect.height()/sy), pm, QPointF(m_subSourceRect.left()*pm.width(), m_subSourceRect.top()*pm.height())); - - painter->setMatrix(originalMatrix); + painter->restore(); } else { QRectF sr(m_subSourceRect.left()*pm.width(), m_subSourceRect.top()*pm.height(), m_subSourceRect.width()*pm.width(), m_subSourceRect.height()*pm.height()); painter->drawPixmap(m_targetRect, pm, sr); } - - painter->setRenderHints(originalHints); } const QPixmap &ImageNode::pixmap() const diff --git a/softwarecontext/rectanglenode.cpp b/softwarecontext/rectanglenode.cpp index a950b900c0..8e3548cf23 100644 --- a/softwarecontext/rectanglenode.cpp +++ b/softwarecontext/rectanglenode.cpp @@ -82,9 +82,6 @@ void RectangleNode::update() void RectangleNode::paint(QPainter *painter) { - QPen originalPen = painter->pen(); - QBrush originalBrush = painter->brush(); - painter->setPen(m_pen); painter->setBrush(m_brush); if (m_radius) @@ -93,7 +90,4 @@ void RectangleNode::paint(QPainter *painter) painter->fillRect(m_rect, m_color); else painter->drawRect(m_rect); - - painter->setPen(originalPen); - painter->setBrush(originalBrush); } |