Skip to content

Use a rectangle handle to control scaling in the transform tools - #1515

Draft
cameronwhite wants to merge 1 commit into
masterfrom
feature/resize-selected-pixels-v2
Draft

Use a rectangle handle to control scaling in the transform tools#1515
cameronwhite wants to merge 1 commit into
masterfrom
feature/resize-selected-pixels-v2

Conversation

@cameronwhite

Copy link
Copy Markdown
Member
  • Use the rectangle handle to control scaling
  • Dragging to translate the region should update the rectangle handles
  • Rotations should also rotate the rectangle handles
  • The Shift key should constrain to the original aspect ratio, not to a square

Fixes: #585

@cameronwhite
cameronwhite force-pushed the feature/resize-selected-pixels-v2 branch from 5bc0005 to caff207 Compare July 3, 2025 01:34
@cameronwhite
cameronwhite force-pushed the feature/resize-selected-pixels-v2 branch from caff207 to 87a1cae Compare August 10, 2025 14:17
@cameronwhite
cameronwhite force-pushed the feature/resize-selected-pixels-v2 branch from 87a1cae to 81731f1 Compare September 1, 2025 02:04
cameronwhite added a commit that referenced this pull request Sep 1, 2025
- 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 added a commit that referenced this pull request Sep 1, 2025
- 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 force-pushed the feature/resize-selected-pixels-v2 branch from 81731f1 to 2150c88 Compare September 1, 2025 15:35
…of selections

- Use the rectangle handle to define how the selected area is scaled
- Update the rectangle handle when dragging to translate the selected area

Bug: #585
@cameronwhite
cameronwhite force-pushed the feature/resize-selected-pixels-v2 branch from 2150c88 to 6b1ae6a Compare September 20, 2025 22:34
@zbcoding

zbcoding commented Jun 3, 2026

Copy link
Copy Markdown

Good feature. Why is this still a WIP?

@cameronwhite

Copy link
Copy Markdown
Member Author

Good feature. Why is this still a WIP?

I haven't had the time to continue working on it

@zbcoding

Copy link
Copy Markdown

I took a run at finishing this checklist in #2239 — it adds handle-follows-rotation and the original-aspect-ratio Shift constraint on top of the scaling/translate handles, plus arrow-key nudge shortcuts and a rotate cursor. Built on your approach here (and @marcovr's branch); happy to fold it into this PR instead if you'd prefer.

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.

Resize selection relative to opposite corner instead of center.

2 participants