-
Notifications
You must be signed in to change notification settings - Fork 326
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
Conversation
app/gui2/src/util/data/vec2.ts
Outdated
@@ -15,6 +15,10 @@ export class Vec2 { | |||
return new Vec2(point.x, point.y) | |||
} | |||
|
|||
static FromTuple(point: [x: number, y: number]): Vec2 { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
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:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.