Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Dragging layers sharing a transform node applies multiple translations

Open 0HyperCube opened this issue 1 year ago • 3 comments

Create a document containing two rectangles. Enter the node graph and add a layer node, using the data from the stroke node of one of the rectangles. Select all of the rectangles and drag them using the select tool. Observe how the translation is applied several times. When you drag around several layers we apply a transformation to the first transform node found for each layer; however because there are several layers sharing the same transform node, the translation is applied several times.

Solutions:

  • In select_tool.rs, instead of applying a delta to the current transform, store the transform at the start of the drag and compute the new transform based on that (similar to how dragging the selection bounds works)
  • In graph_operation_message_handler.rs, check for cases where the node is used by several other nodes, and if that is the case then create a new transform node for each layer separately before applying the operation.

https://github.com/GraphiteEditor/Graphite/assets/78500760/8011ef59-a055-4e29-87a8-9df5d73351e6

0HyperCube avatar Dec 20 '23 16:12 0HyperCube

can i get assigned

devharsh2k4 avatar Mar 05 '24 18:03 devharsh2k4

@devharsh2k4 when you submit a draft PR.

0HyperCube avatar Mar 05 '24 19:03 0HyperCube

I have opened a pull request for this issue. Please assign this issue to me. @Keavon

shipp02 avatar Mar 15 '24 02:03 shipp02