Skip to content

Add Shift+Enter to finish polygon creation by closing the shape#4497

Open
PrateekSingh070 wants to merge 2 commits into
mapeditor:masterfrom
PrateekSingh070:fix/shift-enter-finish-polygon
Open

Add Shift+Enter to finish polygon creation by closing the shape#4497
PrateekSingh070 wants to merge 2 commits into
mapeditor:masterfrom
PrateekSingh070:fix/shift-enter-finish-polygon

Conversation

@PrateekSingh070
Copy link
Copy Markdown

@PrateekSingh070 PrateekSingh070 commented Apr 6, 2026

While creating a polygon or extending a polyline, pressing Shift+Enter now closes the shape as a polygon. This requires at least three points, matching the existing behavior when clicking the first point to close. Plain Enter still finishes as a polyline.

Implements the TODO left in createpolygonobjecttool.cpp and follows up on the Backspace support added in #4372.

Copilot AI review requested due to automatic review settings April 6, 2026 20:35
@PrateekSingh070 PrateekSingh070 force-pushed the fix/shift-enter-finish-polygon branch from 65f4c38 to 0f6ae65 Compare April 6, 2026 20:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a keyboard shortcut to close an in-progress polygon as a polygon (instead of finishing as a polyline), and documents the new behavior.

Changes:

  • Handle Shift+Enter in CreatePolygonObjectTool::keyPressed to finish as a polygon when there are at least 3 points.
  • Update user-facing docs and release notes to mention the new shortcut.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/tiled/createpolygonobjecttool.cpp Implements Shift+Enter handling to close the shape and finish as a polygon.
NEWS.md Notes the new Shift+Enter behavior in Unreleased changes.
docs/manual/objects.rst Documents Shift+Enter as an alternative to clicking the first point to close a polygon.
docs/manual/keyboard-shortcuts.rst Lists Shift+Enter as “finish as polygon” while creating polygons/polylines.

Comment thread docs/manual/objects.rst Outdated
Comment thread docs/manual/objects.rst Outdated
Comment thread docs/manual/keyboard-shortcuts.rst Outdated
@PrateekSingh070 PrateekSingh070 force-pushed the fix/shift-enter-finish-polygon branch from 0f6ae65 to 915c8cd Compare April 24, 2026 20:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants