mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Element editor : finish the creation of polyline with the last point at the same position of the first point, close the polyline.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5869 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -110,7 +110,12 @@ bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
if (m_polygon)
|
if (m_polygon)
|
||||||
{
|
{
|
||||||
m_polygon->removeLastPoint();
|
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
|
//Set m_polygon to nullptr for create new polygon at next mouse press
|
||||||
m_polygon = nullptr;
|
m_polygon = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user