Disable automatically panning to elements that aren't entirely visible? #102
Unanswered
CannibalKush
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Here are some options: 1. Undo the last change to the viewport when it becomes invalidI would suggest using js-draw/packages/js-draw/src/Editor.ts Lines 443 to 470 in e11574b Note that the logic above resets the zoom level to Related documentation: 2. Make the DOM match js-draw's scrollThis solution would also use
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
I'm using some voodoo to pin the JS-draw canvas' viewport to the exact same place as the DOM's scroll.
This may or may not be a good idea, but the issue I'm experiencing is that, if I draw something on the edge of the viewport, then select it, my viewport pans so that that element is in the middle (breaking this pinning I'm trying to do).
Describe the solution you'd like
I'd like some way to disable this auto-pan behaviour.
Describe alternatives you've considered
I've looked through a bunch of the methods provided by the Editor and Viewport code, but I couldn't find anything that would disable this behavior.
I would be happy to learn that this is something that already exists!
Beta Was this translation helpful? Give feedback.
All reactions