Diagram editor : when user add a polygon, if the last point is at the same position of the first, then the polygon is closed.

Undo commit 5862


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5863 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-05-16 17:38:13 +00:00
parent 4503132140
commit 2f9b101c19
2 changed files with 11 additions and 5 deletions

View File

@@ -601,7 +601,7 @@ void QETDiagramEditor::setUpActions()
add_rectangle->setData("rectangle");
add_ellipse ->setData("ellipse");
add_polyline ->setData("polyline");
for(QAction *action : m_add_item_actions_group.actions()) {
action->setCheckable(true);
}
@@ -1300,11 +1300,8 @@ void QETDiagramEditor::addItemGroupTriggered(QAction *action)
diagram_event = new DiagramEventAddShape (d, QetShapeItem::Rectangle);
else if (value == "ellipse")
diagram_event = new DiagramEventAddShape (d, QetShapeItem::Ellipse);
else if (value == "polyline") {
else if (value == "polyline")
diagram_event = new DiagramEventAddShape (d, QetShapeItem::Polygon);
setToolTip(tr("Double-click pour terminer la forme"));
setToolTipDuration(2000);
}
else if (value == "image")
{
DiagramEventAddImage *deai = new DiagramEventAddImage(d);