mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02: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:
parent
3f9685832d
commit
28cceca3c5
@ -110,7 +110,12 @@ bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user