Skip to content

Refactor how the DocumentSelection bounds are tracked - #1712

Merged
cameronwhite merged 1 commit into
masterfrom
refactor/selection-bounds
Sep 1, 2025
Merged

Refactor how the DocumentSelection bounds are tracked#1712
cameronwhite merged 1 commit into
masterfrom
refactor/selection-bounds

Conversation

@cameronwhite

Copy link
Copy Markdown
Member
  • Store a rectangle rather than separate origin / end points. This is simpler, and for PR Use a rectangle handle to control scaling in the transform tools #1515 this will likely be extended further to also store an orientation

  • Clarify that the bounds are only used for interactive manipulation by tools, and might not reflect the selection's entire bounds when e.g. using intersection modes

  • Adjust the TransformPoint() signature to be easier to use

- Store a rectangle rather than separate origin / end points. This is simpler, and for PR #1515 this will likely be extended further to also store an orientation

- Clarify that the bounds are only used for interactive manipulation by tools, and might not reflect the selection's entire bounds when e.g. using intersection modes

- Adjust the `TransformPoint()` signature to be easier to use
@cameronwhite
cameronwhite merged commit 51c4c77 into master Sep 1, 2025
12 of 13 checks passed
@cameronwhite
cameronwhite deleted the refactor/selection-bounds branch September 1, 2025 15:29
zbcoding added a commit to zbcoding/Pinta that referenced this pull request Jul 29, 2026
…aProject#585)

Completes the checklist from the draft PR PintaProject#1515 by wiring RectangleHandle
into BaseTransformTool so the Move Selected/Selection tools expose grips:

- Use the rectangle handle to control scaling, anchored to the opposite
  corner (or edge) instead of the center; Ctrl anchors to the center.
- Dragging to translate (mouse or arrow keys) keeps the handles glued to
  the moved region.
- Rotations rotate the handles too: a live orientation matrix maps a fixed
  reference rect onto the current on-screen quad, and grip drags are mapped
  back through its inverse so rotated content scales along its own axes with
  the opposite oriented corner pinned and no shear.
- Shift constrains to the content's original aspect ratio rather than to a
  square.

Also draggable corners can flip/mirror the content when pulled past the
opposite edge, and holding a modifier over a grip shows a hint. Arrow keys
nudge (Shift = 10px, Ctrl = 10% of canvas) with a hint after a short hold
(issue PintaProject#1559). Adds a high-contrast bidirectional rotate cursor icon.

Credit: cameronwhite (draft PR PintaProject#1515, refactor PR PintaProject#1712) and marcovr
(master...marcovr:Pinta:allow-handle-resize) for the handle-resize approach
this builds on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zbcoding added a commit to zbcoding/Pinta that referenced this pull request Jul 29, 2026
…aProject#585)

Completes the checklist from the draft PR PintaProject#1515 by wiring RectangleHandle
into BaseTransformTool so the Move Selected/Selection tools expose grips:

- Use the rectangle handle to control scaling, anchored to the opposite
  corner (or edge) instead of the center; Ctrl anchors to the center.
- Dragging to translate (mouse or arrow keys) keeps the handles glued to
  the moved region.
- Rotations rotate the handles too: a live orientation matrix maps a fixed
  reference rect onto the current on-screen quad, and grip drags are mapped
  back through its inverse so rotated content scales along its own axes with
  the opposite oriented corner pinned and no shear.
- Shift constrains to the content's original aspect ratio rather than to a
  square.

Also draggable corners can flip/mirror the content when pulled past the
opposite edge, and holding a modifier over a grip shows a hint. Arrow keys
nudge (Shift = 10px, Ctrl = 10% of canvas) with a hint after a short hold
(issue PintaProject#1559). Adds a high-contrast bidirectional rotate cursor icon.

Credit: cameronwhite (draft PR PintaProject#1515, refactor PR PintaProject#1712) and marcovr
(master...marcovr:Pinta:allow-handle-resize) for the handle-resize approach
this builds on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zbcoding added a commit to zbcoding/Pinta that referenced this pull request Jul 29, 2026
…aProject#585)

Completes the checklist from the draft PR PintaProject#1515 by wiring RectangleHandle
into BaseTransformTool so the Move Selected/Selection tools expose grips:

- Use the rectangle handle to control scaling, anchored to the opposite
  corner (or edge) instead of the center; Ctrl anchors to the center.
- Dragging to translate (mouse or arrow keys) keeps the handles glued to
  the moved region.
- Rotations rotate the handles too: a live orientation matrix maps a fixed
  reference rect onto the current on-screen quad, and grip drags are mapped
  back through its inverse so rotated content scales along its own axes with
  the opposite oriented corner pinned and no shear.
- Shift constrains to the content's original aspect ratio rather than to a
  square.

Also draggable corners can flip/mirror the content when pulled past the
opposite edge, and holding a modifier over a grip shows a hint. Arrow keys
nudge (Shift = 10px, Ctrl = 10% of canvas) with a hint after a short hold
(issue PintaProject#1559). Adds a high-contrast bidirectional rotate cursor icon.

Credit: cameronwhite (draft PR PintaProject#1515, refactor PR PintaProject#1712) and marcovr
(master...marcovr:Pinta:allow-handle-resize) for the handle-resize approach
this builds on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.

1 participant