diff options
author | Louai Al-Khanji <louai.al-khanji@digia.com> | 2014-08-18 10:29:16 +0300 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-18 10:29:57 +0300 |
commit | 3833d010c93b6c8d56ee8365e08ab47236e4af5a (patch) | |
tree | ec33ecb7939bdac5ffd52a0953df98d056a52c6d | |
parent | 3574eed7f97e126459cdbd0ca63690e059f1e8d0 (diff) |
Revert "Save and restore changed QPainter properties"
The above commit was accidentally pushed.
This reverts commit 4e55b36b29e2114c7edfd53b62f04a6029bab6d6
Change-Id: I48bf983475e98365b62302ff0c37234a73774b79
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-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); } |