summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/filledrectangletool.cpp
Side-by-side diff
Diffstat (limited to 'noncore/graphics/drawpad/filledrectangletool.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/drawpad/filledrectangletool.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/filledrectangletool.cpp b/noncore/graphics/drawpad/filledrectangletool.cpp
new file mode 100644
index 0000000..388acbd
--- a/dev/null
+++ b/noncore/graphics/drawpad/filledrectangletool.cpp
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * *
+ * DrawPad - a drawing program for Opie Environment *
+ * *
+ * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filledrectangletool.h"
+
+#include "drawpad.h"
+#include "drawpadcanvas.h"
+
+FilledRectangleTool::FilledRectangleTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas)
+ : ShapeTool(drawPad, drawPadCanvas)
+{
+}
+
+FilledRectangleTool::~FilledRectangleTool()
+{
+}
+
+void FilledRectangleTool::drawFinalShape(QPainter& p)
+{
+ p.setRasterOp(Qt::NotROP);
+ p.drawRect(QRect(m_polyline[2], m_polyline[0]));
+ p.setRasterOp(Qt::CopyROP);
+ p.fillRect(QRect(m_polyline[2], m_polyline[0]), m_pDrawPad->brush());
+ p.setPen(m_pDrawPad->pen());
+ p.drawRect(QRect(m_polyline[2], m_polyline[0]));
+}
+
+void FilledRectangleTool::drawTemporaryShape(QPainter& p)
+{
+ p.setRasterOp(Qt::NotROP);
+ p.drawRect(QRect(m_polyline[2], m_polyline[1]));
+ p.drawRect(QRect(m_polyline[2], m_polyline[0]));
+}