Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Fix doubled translation from dragging layers sharing an upstream Transform node

Open shipp02 opened this issue 1 year ago • 7 comments

Hello,

This fixes above issue, demo:

https://github.com/GraphiteEditor/Graphite/assets/51503822/70b7fccb-8520-45d5-a599-0b4f8ce24ecf

Closes #1529

shipp02 avatar Mar 12 '24 07:03 shipp02

@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.

Keavon avatar Mar 14 '24 22:03 Keavon

@shipp02 please leave a comment in the original issue so I can assign it to you.

Keavon avatar Mar 15 '24 01:03 Keavon

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 avatar Mar 16 '24 07:03 Keavon

@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)

0HyperCube avatar Mar 22 '24 17:03 0HyperCube

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 avatar Mar 22 '24 17:03 shipp02

@shipp02 just checking if you've been able to continue addressing this.

Keavon avatar Apr 04 '24 04:04 Keavon

I was able to reproduce the regression you mentioned but wasn't sure how to fix it.

shipp02 avatar Apr 10 '24 05:04 shipp02

I'm going to close this for now but feel free to reopen it if you're able to continue making progress.

Keavon avatar Apr 24 '24 06:04 Keavon