Skip to content

Annotation rotation (part 3): rotation aware map tools (Request in QGIS) #11226

Description

@qgis-bot

Request for documentation

From pull request qgis/QGIS#67101
Author: @3nids
QGIS version: 4.4

Annotation rotation (part 3): rotation aware map tools

PR Description:

Description

Makes the annotation map tools aware of item rotation, completing the work split
out of #66610 (after #67035 and #67036).

Screen.Recording.2026-06-29.at.17.47.52.mov

QgsMapToolSelectAnnotation draws the selection band and its mouse handles
rotated together with the item, and QgsMapToolModifyAnnotation places the
vertex handles on the rotated corners and supports resizing a rotated item by
dragging one of them. The drag keeps the opposite corner fixed on screen and
reconstructs the new (axis aligned) item bounds from the un-rotated diagonal.

To apply such a resize a new QgsAnnotationItemEditOperationSetItemBounds
edit operation is added, since the existing MoveNode operation can only set a
single corner of the unrotated bounds, which is not what a rotated resize
produces.

Tests are added for moving an item on a rotated canvas, rotating an item and
resizing a rotated item.

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.

Commits tagged with [need-docs] or [FEATURE]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions