Implement Backspace key support for polygon/polyline creation by dhruv1955 · Pull Request #4372 · mapeditor/tiled (original) (raw)
and others added 2 commits
- Add Backspace key handling in CreatePolygonObjectTool::keyPressed()
- Remove last placed point during polygon/polyline creation
- Support both creating and extending modes
- Update overlay polygon and handles appropriately
- Cancel object when reduced to single point (minimum 2 points required)
Fixes TODO comment about Backspace functionality for going back one step.
Signed-off-by: dhruv1955 dhruvyadav042905@gmail.com
Include QKeyEvent.
Don't call updateHandles() and synchronizeOverlayObject() in extending mode, because this already happens as necessary in CreatePolygonObjectTool::objectsChanged.
Ignore Backspace in extending mode when only two points remain to avoid invalid one-point polylines. Also document Backspace support in NEWS and manual keyboard/object editing sections.
This was referenced
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})