Skip to content
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

feat(nodes): Center pasted nodes at mouse location #4595

Merged
merged 11 commits into from
Sep 21, 2023

Conversation

CrypticWit
Copy link
Contributor

@CrypticWit CrypticWit commented Sep 20, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Community Node Submission

Have you discussed this change with the InvokeAI team?

  • Yes
  • No, because: Wrote this for myself initially

Have you updated all relevant documentation?

  • Yes
  • No

Description

Updated the node copy/paste behaviour so that the newly pasted nodes are created where the mouse is pointing. When there are multiple nodes being pasted, they'll be positioned so the mouse is in the center (by average) of the pasted nodes. I've found this makes the process of copying and pasting nodes a lot more user-friendly, particularly with larger workflows.

I haven't written any sort of React before, so I am not sure if my way of implementing retrieving and tracking mouse position is correct, or if there is a better way of implementing it. Happy to make whatever sort of updates are required if the way I've done it needs rewriting.

@CrypticWit CrypticWit changed the title feat(nodes): Center pasted nodes at mosue location feat(nodes): Center pasted nodes at mouse location Sep 20, 2023
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! As mentioned on discord, I've implemented my requested changes and added context for each to the PR.

@psychedelicious psychedelicious merged commit f87b042 into invoke-ai:main Sep 21, 2023
8 checks passed
@CrypticWit CrypticWit deleted the feat/paste_on_mouse branch September 21, 2023 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants