Diffstat (limited to 'noncore/graphics/drawpad/shapetool.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/shapetool.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/graphics/drawpad/shapetool.cpp b/noncore/graphics/drawpad/shapetool.cpp index 8870a78..22e3dd6 100644 --- a/noncore/graphics/drawpad/shapetool.cpp +++ b/noncore/graphics/drawpad/shapetool.cpp @@ -33,4 +33,6 @@ ShapeTool::~ShapeTool() void ShapeTool::mousePressEvent(QMouseEvent* e) { + m_pDrawPadCanvas->backupPage(); + m_mousePressed = true; m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); @@ -42,5 +44,5 @@ void ShapeTool::mouseReleaseEvent(QMouseEvent* e) QPainter painter; - painter.begin(m_pDrawPadCanvas->currentPage()); + painter.begin(m_pDrawPadCanvas->currentPage()->pixmap()); drawFinalShape(painter); painter.end(); @@ -57,11 +59,9 @@ void ShapeTool::mouseReleaseEvent(QMouseEvent* e) bitBlt(m_pDrawPadCanvas->viewport(), viewportRect.x(), viewportRect.y(), - m_pDrawPadCanvas->currentPage(), r.x(), r.y(), r.width(), r.height()); + m_pDrawPadCanvas->currentPage()->pixmap(), r.x(), r.y(), r.width(), r.height()); m_pDrawPadCanvas->viewport()->update(viewportRect); m_mousePressed = false; - - m_pDrawPadCanvas->backupPage(); } @@ -71,5 +71,5 @@ void ShapeTool::mouseMoveEvent(QMouseEvent* e) m_polyline[0] = e->pos(); QPainter painter; - painter.begin(m_pDrawPadCanvas->currentPage()); + painter.begin(m_pDrawPadCanvas->currentPage()->pixmap()); drawTemporaryShape(painter); painter.end(); @@ -86,5 +86,5 @@ void ShapeTool::mouseMoveEvent(QMouseEvent* e) bitBlt(m_pDrawPadCanvas->viewport(), viewportRect.x(), viewportRect.y(), - m_pDrawPadCanvas->currentPage(), r.x(), r.y(), r.width(), r.height()); + m_pDrawPadCanvas->currentPage()->pixmap(), r.x(), r.y(), r.width(), r.height()); m_pDrawPadCanvas->viewport()->update(viewportRect); |