New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to remove an edge from polygon #1685

Merged
merged 6 commits into from Aug 15, 2017

Rename edge->segment

  • Loading branch information...
ketanhwr committed Aug 15, 2017
commit 2d9b597dc82e1f2a9f4eb46caad56cc534984826
@@ -626,7 +626,7 @@ void EditPolygonTool::showHandleContextMenu(PointHandle *clickedHandle,
MapObject *secondMapObject = (n > 1) ? secondHandle->mapObjectItem()->mapObject(): nullptr;
if (mapObject->shape() == MapObject::Polygon) {
QAction *deleteEdge = menu.addAction(tr("Delete Edge"));
QAction *deleteSegment = menu.addAction(tr("Delete Segment"));
bool enabled = false;
if (mSelectedHandles.size() == 2 && mapObject == secondMapObject) {
@@ -635,8 +635,8 @@ void EditPolygonTool::showHandleContextMenu(PointHandle *clickedHandle,
enabled = true;
}
deleteEdge->setEnabled(enabled);
connect(deleteEdge, SIGNAL(triggered()), SLOT(deleteEdge()));
deleteSegment->setEnabled(enabled);
connect(deleteSegment, SIGNAL(triggered()), SLOT(deleteSegment()));
}
menu.exec(screenPos);
@@ -892,7 +892,7 @@ void EditPolygonTool::splitSegments()
undoStack->endMacro();
}
void EditPolygonTool::deleteEdge()
void EditPolygonTool::deleteSegment()
{
if (mSelectedHandles.size() != 2)
return;
@@ -919,7 +919,7 @@ void EditPolygonTool::deleteEdge()
setSelectedHandles(QSet<PointHandle*>());
mapDocument()->undoStack()->beginMacro(tr("Delete Edge"));
mapDocument()->undoStack()->beginMacro(tr("Delete Segment"));
mapDocument()->undoStack()->push(new ChangePolygon(mapDocument(), mapObject, newPolygon, polygon));
mapDocument()->undoStack()->push(new TogglePolygonPolyline(mapObject));
mapDocument()->undoStack()->endMacro();
@@ -68,7 +68,7 @@ private slots:
void joinNodes();
void splitSegments();
void deleteEdge();
void deleteSegment();
private:
enum Mode {
ProTip! Use n and p to navigate between commits in a pull request.