[qet] qet/qet: [5869] Element editor : finish the creation of polyline with the last point at the same position of the first point , close the polyline. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
- To: qet@xxxxxxxxxxxxxxxxxxx
- Subject: [qet] qet/qet: [5869] Element editor : finish the creation of polyline with the last point at the same position of the first point , close the polyline.
- From: subversion@xxxxxxxxxxxxx
- Date: Sat, 18 May 2019 21:49:27 +0200
Revision: 5869
Author: blacksun
Date: 2019-05-18 21:49:27 +0200 (Sat, 18 May 2019)
Log Message:
-----------
Element editor : finish the creation of polyline with the last point at the same position of the first point, close the polyline.
Modified Paths:
--------------
trunk/sources/editor/esevent/eseventaddpolygon.cpp
Modified: trunk/sources/editor/esevent/eseventaddpolygon.cpp
===================================================================
--- trunk/sources/editor/esevent/eseventaddpolygon.cpp 2019-05-18 19:35:57 UTC (rev 5868)
+++ trunk/sources/editor/esevent/eseventaddpolygon.cpp 2019-05-18 19:49:27 UTC (rev 5869)
@@ -110,7 +110,12 @@
if (m_polygon)
{
m_polygon->removeLastPoint();
- m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Polygone"), m_scene, m_polygon));
+ if (m_polygon->polygon().first() == m_polygon->polygon().last())
+ {
+ m_polygon->removeLastPoint();
+ m_polygon->setClosed(true);
+ }
+ m_scene->undoStack().push(new AddPartCommand(QObject::tr("Polygone"), m_scene, m_polygon));
//Set m_polygon to nullptr for create new polygon at next mouse press
m_polygon = nullptr;