GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.76k stars 408 forks source link

Can't drag selected layers. #1728

Closed nico-mayora closed 3 months ago

nico-mayora commented 5 months ago

I'm not really sure what this happens but to reproduce the issue:

  1. Load up this file on the editor. (Had to change the extension to .json or GitHub wouldn't let me upload it).
  2. Choose the Select Tool, then select all layers (Ctrl+A).
  3. Try to move the selection by dragging, but you'll notice you can only stretch it on the X axis.
  4. Pressing G and moving the mouse still works as expected.
0HyperCube commented 5 months ago

Thanks for reporting @nico-mayora - this is because the click testing for the transform bounds (transformation_cage.rs:254) is done in the transform space of the first layer instead of the viewport space. This was done to support the rotated bounding box functionality. The tolerance is based only on the Y scale of the shape, so if the shape has a very large X scale and a small y scale then the value will seem wrong.

Keavon commented 3 months ago

This might still be a bug however the provided file can't be opened in the current version of Graphite so it's not easy to tell what problem is described here unless steps can be provided about how to create the situation that the file highlights starting from a new document. Feel free to update this issue with those steps, or otherwise we'll probably notice that issue eventually and report or fix it outside of this issue. But since this issue isn't easy to actually address in its current form, I'll close it for the moment.