mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
Element editor : Add animation for some undo/redo
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4060 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -103,13 +103,16 @@ bool ESEventAddPolygon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::LeftButton) {
|
||||
if (m_polygon) {
|
||||
m_polygon -> addPoint(m_scene -> snapToGrid(event -> scenePos()));
|
||||
bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event -> button() == Qt::LeftButton)
|
||||
{
|
||||
if (m_polygon)
|
||||
{
|
||||
m_polygon->removeLastPoint();
|
||||
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;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user