Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: rotate snap indicator and snap rotated items #1168

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

letsfindaway
Copy link
Collaborator

This PR applies the snap-to-grid function correctly to rotated items. It tries to make snapping more foreseeable and toi better fit user expectations for rotated items.

  • When moving an arbitrarily rotated item the corners of the item snap. Snap indicators are now correctly shown at the item corners. Until now, a scene bounding rectangle of the item snapped and the snap indicators have been shown on that virtual, invisible rectangle.
  • Snapping is now also correctly applied to flipped items.
  • Resizing of rotated items can now also snap to the grid if the angle is 0°, 90°, 180° or 270°. For other angles it makes no sense to snap resizing.
  • Scaling of an item (i.e. resizing with the bottom-right handle) never snaps.

See also letsfindaway#185 for a discussion of this feature and the list of tests I have conducted.

- add optional angle parameter
- use painter rotation to draw triangle at any angle
- snap rotated item when moving w/o delegate frame
- snap rotated item when moving by delegate frame
- snap resizing for rotation angles 0 / 90 / 180 / 270
- snap newly drawn rotated line at line end points
  instead of outline
@letsfindaway letsfindaway force-pushed the feat-rotate-snap-indicator branch from 8e8aacd to 55a2144 Compare November 21, 2024 17:14
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