-
Notifications
You must be signed in to change notification settings - Fork 110
Use telephoto for panning and zooming #1422
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
base: main
Are you sure you want to change the base?
Conversation
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.
The zoom behaviour and locking of content to the bounds of the window feels much better now as does the double to click to zoom. The scroll wheel zooming is buggy and honestly I don't think needed at all given how well double click to zoom works.
scope.launch { | ||
// TODO: this doesn't work super well. | ||
// Probably because of https://github.com/saket/telephoto/issues/135? | ||
zoomableState.zoomTo( |
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.
From local testing this isn't adjusting the pan at all when selecting a node.
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.
This should be fixed by saket/telephoto@68fcaef. Do you mind if I update telephoto
to its latest snapshot version?
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.
Nope go for it
Box( | ||
modifier = modifier.onSizeChanged { | ||
appWindowSize = it | ||
// TODO: do we want to draw behind the search bar? |
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 drawing behind the search looks correct, which is what it's doing already, if we didn't allow it there would be a jarring cutoff.
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.
In that case, do you want to synchronize the content padding below with the search box's height?
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'm not sure, I think it was looking good how it was now.
|
||
val focusRequester = remember { FocusRequester() } | ||
LaunchedEffect(zoomableState) { | ||
// Request focus to receive keyboard shortcuts. |
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.
This is turning out to be more complex than I expected. The content starts in a focused state but loses focus when the search box is clicked. We'll have to restore focus when a search result is selected. Let me try fixing this.
Re-opened: #1421