00001 /*************************************************************************** 00002 * * 00003 * DrawPad - a drawing program for Opie Environment * 00004 * * 00005 * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 ***************************************************************************/ 00013 00014 #include "rectangletool.h" 00015 00016 #include "drawpad.h" 00017 #include "drawpadcanvas.h" 00018 00019 RectangleTool::RectangleTool(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas) 00020 : ShapeTool(drawPad, drawPadCanvas) 00021 { 00022 } 00023 00024 RectangleTool::~RectangleTool() 00025 { 00026 } 00027 00028 void RectangleTool::drawFinalShape(QPainter& p) 00029 { 00030 p.setRasterOp(Qt::NotROP); 00031 p.drawRect(QRect(m_polyline[2], m_polyline[0])); 00032 p.setPen(m_pDrawPad->pen()); 00033 p.setRasterOp(Qt::CopyROP); 00034 p.drawRect(QRect(m_polyline[2], m_polyline[0])); 00035 } 00036 00037 void RectangleTool::drawTemporaryShape(QPainter& p) 00038 { 00039 p.setRasterOp(Qt::NotROP); 00040 p.drawRect(QRect(m_polyline[2], m_polyline[1])); 00041 p.drawRect(QRect(m_polyline[2], m_polyline[0])); 00042 }
1.4.2