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

Moving nodes or camera with arrows #10179

Merged
merged 12 commits into from
Jun 6, 2024
Merged

Conversation

farmaazon
Copy link
Contributor

@farmaazon farmaazon commented Jun 5, 2024

Pull Request Description

Fixes #10029

Screencast.from.2024-06-05.11-40-50.webm

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@farmaazon farmaazon added CI: No changelog needed Do not require a changelog entry for this PR. -gui labels Jun 5, 2024
@farmaazon farmaazon self-assigned this Jun 5, 2024
@farmaazon farmaazon added the x-new-feature Type: new feature request label Jun 5, 2024
@@ -15,6 +15,10 @@ export class Vec2 {
return new Vec2(point.x, point.y)
}

static FromTuple(point: [x: number, y: number]): Vec2 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be unused

@@ -258,6 +271,7 @@ export function useNavigator(viewportNode: Ref<Element | undefined>, keyboard: K

return proxyRefs({
events: {
...panArrows.events,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's good idea to spread those. The returned events are all bound with v-on to the wrapping div, which probably is unintentional here.

})
useEvent(window, 'keyup', (event) => graphNavigator.events.keyup(event))
Copy link
Contributor

@Frizi Frizi Jun 5, 2024

Choose a reason for hiding this comment

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

Imo this should be part of the graphNavigator itself (or even useArrows). It should be harmless to always handle keyup if all it does is ends an action that had to first be started by a handled keydown.

export function useNavigator(
viewportNode: Ref<Element | undefined>,
keyboard: KeyboardComposable,
predicate: (e: PointerEvent | KeyboardEvent) => boolean = (_) => true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this deserves an Options interface now.

@farmaazon farmaazon removed the CI: No changelog needed Do not require a changelog entry for this PR. label Jun 5, 2024
@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label Jun 6, 2024
@mergify mergify bot merged commit 291db8a into develop Jun 6, 2024
37 checks passed
@mergify mergify bot deleted the wip/farmaazon/moving-with-arrows branch June 6, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-gui CI: Ready to merge This PR is eligible for automatic merge x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to move the selected components(s) using the arrow keys
2 participants