src/tools/circletool.cpp

Thu, 14 Apr 2022 11:08:20 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 14 Apr 2022 11:08:20 +0300
changeset 186
922662adb72a
child 187
30204975694a
permissions
-rw-r--r--

work on circle tool

186
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #include "circletool.h"
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 CircleTool::CircleTool(Document *document) :
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 AbstractDrawTool{document}
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 QString CircleTool::name() const
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 return tr("Circle");
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 QString CircleTool::toolTip() const
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 return tr("Draw circular primitives like circles or discs");
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 void CircleTool::overpaint(Canvas *canvas, QPainter *painter) const
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 if (this->previewPolygon.size() >= 2)
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 canvas->drawWorldPolyline()
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 QString CircleTool::iconName() const
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 return ":/icons/linetype-circularprimitive.png";
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 }
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
31 void CircleTool::closeShape()
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 {
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33
922662adb72a work on circle tool
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 }

mercurial