Skip to content

feat(terra-draw): Rotate drag handle#851

Draft
DanielBoa wants to merge 10 commits into
JamesLMilner:mainfrom
DanielBoa:rotate-drag-handle
Draft

feat(terra-draw): Rotate drag handle#851
DanielBoa wants to merge 10 commits into
JamesLMilner:mainfrom
DanielBoa:rotate-drag-handle

Conversation

@DanielBoa

@DanielBoa DanielBoa commented Mar 31, 2026

Copy link
Copy Markdown

Description of Changes

Note: I've not yet added tests or documentation as I'm seeking others input before working on this any further.

Add a handle offset from the top edge of a selected feature which allows for the feature to be rotated without the need for keyboard shortcuts.

terra-draw-rotate-handle-demo.mp4

The linked issue mentions another possible UX, the ability to rotate a feature by moving your mouse close to a coordinate and having the cursor update to communicate that a drag is possible. I think this is nice, however I think this approach of having a bounding box and offset drag handle is preferable (in my particular use case) for two main reasons:

  1. This approach allows for the interaction to possibly work on touch devices
  2. The corners of the bounding box could also be turned into handles allowing the feature to be scaled

I've tried to follow the patterns I've observed in the select.mode.ts and it's accompanying "behaviours" when implementing this feature, although as I've mentioned above I've stopped short of making this production ready as I want to gauge the feeling of this UX approach to the problem before working on it anymore.

If the greenlight was given to this UX then I think it might make sense to extract the guide bounding box logic I've introduce into another behaviour that could also be used by the ScaleFeatureBehavior to attach the scaling handles.

Feedback would be greatly appreciated.

Link to Issue

#626

PR Checklist

  • The PR title follows the conventional commit standard
  • There is a associated GitHub issue
  • If I have added significant code changes, there are relevant tests
  • If there are behaviour changes these are documented

@JamesLMilner

Copy link
Copy Markdown
Owner

Hey @DanielBoa - this looks really interesting, I will take a proper look when I get a moment!

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.

2 participants