Skip to content

Duplicate the selected layers #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Keavon opened this issue Jun 12, 2021 · 6 comments · Fixed by #214
Closed

Duplicate the selected layers #189

Keavon opened this issue Jun 12, 2021 · 6 comments · Fixed by #214
Assignees
Labels
Good First Issue Good for newcomers
Milestone

Comments

@Keavon
Copy link
Member

Keavon commented Jun 12, 2021

Ctrl+D to duplicate the selected layers.

This should be a relatively simple task purely touching the Rust codebase. If you're interested in this issue, we can answer questions and write up a guide of steps to implement this feature.

@tillarnold
Copy link
Contributor

I'd be interested in taking this task.

@Keavon
Copy link
Member Author

Keavon commented Jun 15, 2021

Perfect, I assigned it to you @tillarnold. @TrueDoctor, would you be able to describe what this task will involve? We don't need layer offset for the duplicated or pasted layer.

@TrueDoctor
Copy link
Member

I'm nor sure how this can be implemented cleanly, the easiest way would be to store a clipboard in the backend and manipulate it through operations but this is far from ideal. The other place to store these would be the editor, but until we have a history system setup we would need to resort to sending layers directly wrapped as operations which is not really idiomatic either.
I don't expect you to understand half of what I just said, It is also mean as a question for @Keavon

@Keavon
Copy link
Member Author

Keavon commented Jun 15, 2021

Let's just do the duplicate part for now, then we can evaluate what is involved in the copy/paste part. @TrueDoctor

@TrueDoctor
Copy link
Member

The easiest way to implement duplicate functionality is to add an Operation Operation::DuplicateLayer{path: Vec<LayerId>}.
That operation then just clones the layer to the same folder it resides in

@Keavon
Copy link
Member Author

Keavon commented Jun 16, 2021

@tillarnold are you on the Discord server for Graphite yet? That's typically the way we onboard new contributors and provide an introduction to the code, either through a chat or voice call format. If that would be beneficial for your understanding, since I realize this may be confusing or vague without any context in the backend codebase. Or if you're the kind of person who's great at just reading through code files to orient yourself, that's also great. Discord is most commonly the easiest way to help you get up to speed but if that's not your thing, we want to help remove friction and confusion whatever it exists on any platform. Please let me or @TrueDoctor what would be best to help us help you succeed.

@TrueDoctor TrueDoctor linked a pull request Jun 16, 2021 that will close this issue
@TrueDoctor TrueDoctor reopened this Jun 16, 2021
@Keavon Keavon changed the title Copy and paste (and duplicate) layers Duplicate the selected layers Jun 16, 2021
@Keavon Keavon closed this as completed Jun 16, 2021
@Keavon Keavon removed the In-Progress label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants