Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
393 stars 70 forks source link

[BUG] Grid snapping resizing doesn't work when shape is rotated #1405

Closed rexy712 closed 4 months ago

rexy712 commented 4 months ago

Describe the bug When resizing a rectangular shape, the dragged corner is snapped to the grid when finished, unless snapping is disabled of course. Everything works as expected when the orientation angle is 0. Rotating the shape causes the corner to seemingly ignore snapping or snap to an incorrect corner. This is easiest to notice it with larger angles of rotation.

To Reproduce Steps to reproduce the behavior:

  1. Create a rectangular shape.
  2. Rotate the shape 180 degrees.
  3. Drag to resize the shape with snapping enabled.

Expected behavior Snapping should function the same regardless of the orientation. Snapping may not be desired in odd orientations (eg 35 degrees) because it's no longer aligned to the grid, but that's what disabling snapping mode is for.

Screenshots

https://github.com/Kruptein/PlanarAlly/assets/2442544/b3fef151-7821-4cfc-a3d7-c7dc42fb4baf

Desktop: