Fix doubled translation from dragging layers sharing an upstream Transform node
Hello,
This fixes above issue, demo:
https://github.com/GraphiteEditor/Graphite/assets/51503822/70b7fccb-8520-45d5-a599-0b4f8ce24ecf
Closes #1529
@0HyperCube you're better than me at understanding this part of the code and the implications of this change. Could you please see if this looks good to go? Thanks.
@shipp02 please leave a comment in the original issue so I can assign it to you.
I finally got a chance to do some QA testing on this. The first thing I noticed is that Dragging individual layers is completely broken. Just draw two layers and try dragging each of them on after the other. This is probably caused by your choice to store the transform in the Select tool's struct. I'd avoid attempting to persist state since this should be a stateless problem as far as I can tell.
@Keavon persisting state is necessary to implement the first of my suggested solutions from the issue:
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)
Thank you for confirming my approach!
I was in the middle of finals hence the lack of a response from me in the last week.
I will fix the bug @Keavon found while he was running QA.
On Fri, Mar 22, 2024, 10:02 AM 0HyperCube @.***> wrote:
@Keavon https://github.com/Keavon persisting state is necessary to implement the first of my suggested solutions from the issue:
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)
— Reply to this email directly, view it on GitHub https://github.com/GraphiteEditor/Graphite/pull/1681#issuecomment-2015522280, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMI6FTXCBTQET5GTNIW5NJDYZRPZZAVCNFSM6AAAAABERUTULCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJVGUZDEMRYGA . You are receiving this because you were mentioned.Message ID: @.***>
@shipp02 just checking if you've been able to continue addressing this.
I was able to reproduce the regression you mentioned but wasn't sure how to fix it.
I'm going to close this for now but feel free to reopen it if you're able to continue making progress.