Skip to content

Commit

Permalink
remove last Polyline point with Backspace
Browse files Browse the repository at this point in the history
when there is only one point left, the Polyline is cancelled entirely as if pressing the Escape key.
  • Loading branch information
HeCorr committed Jul 20, 2024
1 parent bbec7bb commit 4fef083
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core_lib/src/tool/polylinetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,21 @@ bool PolylineTool::keyPressEvent(QKeyEvent* event)
}
break;

case Qt::Key_Backspace:
if (mPoints.size() > 1)
{
mPoints.removeLast();
drawPolyline(mPoints, getCurrentPoint());
return true;
}
else if (mPoints.size() == 1)
{
cancelPolyline();
clearToolData();
return true;
}
break;

default:
break;
}
Expand Down

0 comments on commit 4fef083

Please sign in to comment.