QTfrontend/drawmapscene.cpp
changeset 5108 b7483e29ea8c
parent 5040 c6cd873ac13a
child 5858 1f4a8cf9efcb
equal deleted inserted replaced
5105:79faa1130011 5108:b7483e29ea8c
    84     emit pathChanged();
    84     emit pathChanged();
    85 }
    85 }
    86 
    86 
    87 void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
    87 void DrawMapScene::mouseReleaseEvent(QGraphicsSceneMouseEvent * mouseEvent)
    88 {
    88 {
    89     QPainterPath path = m_currPath->path();
    89     if (m_currPath)
    90     path.lineTo(mouseEvent->scenePos());
    90     {
    91     paths.first().append(mouseEvent->scenePos().toPoint());
    91         QPainterPath path = m_currPath->path();
    92     m_currPath->setPath(path);
    92         path.lineTo(mouseEvent->scenePos());
    93 
    93         paths.first().append(mouseEvent->scenePos().toPoint());
    94     simplifyLast();
    94         m_currPath->setPath(path);
    95 
    95 
    96     m_currPath = 0;
    96         simplifyLast();
       
    97 
       
    98         m_currPath = 0;
       
    99     }
    97 }
   100 }
    98 
   101 
    99 void DrawMapScene::undo()
   102 void DrawMapScene::undo()
   100 {
   103 {
   101     if(items().size())
   104     if(items().size())