author | leseb <leseb> | 2002-07-10 21:59:27 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-07-10 21:59:27 (UTC) |
commit | f568737c20bea96fb79d85681a72e142ec05d66f (patch) (unidiff) | |
tree | 80d08b351bbdeec5be93885a4c18ba0207ef990a /noncore/graphics/drawpad/erasetool.cpp | |
parent | 01b04adb73c8bc49938b71a4bebe6fb6a5477f75 (diff) | |
download | opie-f568737c20bea96fb79d85681a72e142ec05d66f.zip opie-f568737c20bea96fb79d85681a72e142ec05d66f.tar.gz opie-f568737c20bea96fb79d85681a72e142ec05d66f.tar.bz2 |
Undo/redo reimplemented
Diffstat (limited to 'noncore/graphics/drawpad/erasetool.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/erasetool.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/graphics/drawpad/erasetool.cpp b/noncore/graphics/drawpad/erasetool.cpp index f77e038..2326da5 100644 --- a/noncore/graphics/drawpad/erasetool.cpp +++ b/noncore/graphics/drawpad/erasetool.cpp | |||
@@ -32,6 +32,8 @@ EraseTool::~EraseTool() | |||
32 | 32 | ||
33 | void EraseTool::mousePressEvent(QMouseEvent* e) | 33 | void EraseTool::mousePressEvent(QMouseEvent* e) |
34 | { | 34 | { |
35 | m_pDrawPadCanvas->backupPage(); | ||
36 | |||
35 | m_mousePressed = true; | 37 | m_mousePressed = true; |
36 | m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); | 38 | m_polyline[2] = m_polyline[1] = m_polyline[0] = e->pos(); |
37 | } | 39 | } |
@@ -41,8 +43,6 @@ void EraseTool::mouseReleaseEvent(QMouseEvent* e) | |||
41 | Q_UNUSED(e) | 43 | Q_UNUSED(e) |
42 | 44 | ||
43 | m_mousePressed = false; | 45 | m_mousePressed = false; |
44 | |||
45 | m_pDrawPadCanvas->backupPage(); | ||
46 | } | 46 | } |
47 | 47 | ||
48 | void EraseTool::mouseMoveEvent(QMouseEvent* e) | 48 | void EraseTool::mouseMoveEvent(QMouseEvent* e) |
@@ -50,7 +50,7 @@ void EraseTool::mouseMoveEvent(QMouseEvent* e) | |||
50 | if (m_mousePressed) { | 50 | if (m_mousePressed) { |
51 | QPainter painter; | 51 | QPainter painter; |
52 | QPen pen(Qt::white, m_pDrawPad->pen().width()); | 52 | QPen pen(Qt::white, m_pDrawPad->pen().width()); |
53 | painter.begin(m_pDrawPadCanvas->currentPage()); | 53 | painter.begin(m_pDrawPadCanvas->currentPage()->pixmap()); |
54 | painter.setPen(pen); | 54 | painter.setPen(pen); |
55 | m_polyline[2] = m_polyline[1]; | 55 | m_polyline[2] = m_polyline[1]; |
56 | m_polyline[1] = m_polyline[0]; | 56 | m_polyline[1] = m_polyline[0]; |
@@ -69,7 +69,7 @@ void EraseTool::mouseMoveEvent(QMouseEvent* e) | |||
69 | m_pDrawPadCanvas->contentsToViewport(r.bottomRight())); | 69 | m_pDrawPadCanvas->contentsToViewport(r.bottomRight())); |
70 | 70 | ||
71 | bitBlt(m_pDrawPadCanvas->viewport(), viewportRect.x(), viewportRect.y(), | 71 | bitBlt(m_pDrawPadCanvas->viewport(), viewportRect.x(), viewportRect.y(), |
72 | m_pDrawPadCanvas->currentPage(), r.x(), r.y(), r.width(), r.height()); | 72 | m_pDrawPadCanvas->currentPage()->pixmap(), r.x(), r.y(), r.width(), r.height()); |
73 | 73 | ||
74 | m_pDrawPadCanvas->viewport()->update(viewportRect); | 74 | m_pDrawPadCanvas->viewport()->update(viewportRect); |
75 | } | 75 | } |