GraphiteEditor / GraphiteEditor/Graphite
Dragging layers sharing a transform node applies multiple translations
- Lingua principale
- Rust
- Stelle
- 27.2k
- Fork
- 1.3k
- Merge medio
- 20h 5m
- PR unite (30g)
- 57
Descrizione
Still a problem as of Jan 30, 2025. This happens with dragging but not G of the G/R/S feature, which is a good hint about how to begin solving it in the same manner.
---
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.
This also applies when dragging the top/left corners of an artboard with the Artboard tool (as was implemented in #2150).
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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start in select_tool.rs and compare dragging with the G/R/S implementation, then inspect graph_operation_message_handler.rs for shared transform nodes. Reproduce the two-rectangle node-graph scenario and the Artboard tool corner drag; done means each layer is translated once even when layers share a transform node.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- computer-graphics
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100