Diffstat (limited to 'noncore/graphics/drawpad/filledellipsetool.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/filledellipsetool.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/filledellipsetool.cpp b/noncore/graphics/drawpad/filledellipsetool.cpp new file mode 100644 index 0000000..b446000 --- a/dev/null +++ b/noncore/graphics/drawpad/filledellipsetool.cpp | |||
@@ -0,0 +1,46 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * DrawPad - a drawing program for Opie Environment * | ||
4 | * * | ||
5 | * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * | ||
6 | * * | ||
7 | * This program is free software; you can redistribute it and/or modify * | ||
8 | * it under the terms of the GNU General Public License as published by * | ||
9 | * the Free Software Foundation; either version 2 of the License, or * | ||
10 | * (at your option) any later version. * | ||
11 | * * | ||
12 | ***************************************************************************/ | ||
13 | |||
14 | #include "filledellipsetool.h" | ||
15 | |||
16 | #include "drawpad.h" | ||
17 | #include "drawpadcanvas.h" | ||
18 | |||
19 | #include <qpainter.h> | ||
20 | #include <qpixmap.h> | ||
21 | |||
22 | FilledEllipseTool::FilledEllipseTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) | ||
23 | : ShapeTool(drawPad, drawPadCanvas) | ||
24 | { | ||
25 | } | ||
26 | |||
27 | FilledEllipseTool::~FilledEllipseTool() | ||
28 | { | ||
29 | } | ||
30 | |||
31 | void FilledEllipseTool::drawFinalShape(QPainter& p) | ||
32 | { | ||
33 | p.setRasterOp(Qt::NotROP); | ||
34 | p.drawRect(QRect(m_polyline[2], m_polyline[0])); | ||
35 | p.setPen(m_pDrawPad->pen()); | ||
36 | p.setBrush(m_pDrawPad->brush()); | ||
37 | p.setRasterOp(Qt::CopyROP); | ||
38 | p.drawEllipse(QRect(m_polyline[2], m_polyline[0])); | ||
39 | } | ||
40 | |||
41 | void FilledEllipseTool::drawTemporaryShape(QPainter& p) | ||
42 | { | ||
43 | p.setRasterOp(Qt::NotROP); | ||
44 | p.drawRect(QRect(m_polyline[2], m_polyline[1])); | ||
45 | p.drawRect(QRect(m_polyline[2], m_polyline[0])); | ||
46 | } | ||