Disable moving the canvas and line width depending on pencil pressure #3089
-
servas, i'm building an own version of tldraw (based on the custom-ui example) for doing written exams. We are using Wacom One displays and students like it. But i would need 2 enhancements to my app to avoid special problems: a) if the student clicks the button on the pen he can move around the canvas (similar by pressing the scroll on the mouse) - but this is something i want to avoid. how can i achieve this? is there a configuration setting (editor.lockCanvas(true) ??) or do i have to modify a event listener "pointerdown" (like the ways i'm able to change the keyboard events)? b) if the student uses the drawing tool, the line width depends on how strong he presses the pen on the screen. i need to avoid this as well, the pen width must be the same all the time. how can this be done?????? any hits to the code would be of great help! ciao |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For preventing camera movement you can do to prevent the drawing tool being pressure sensitive, you can switch from the 'draw' dash style to the |
Beta Was this translation helpful? Give feedback.
For preventing camera movement you can do
editor.updateInstanceState({canMoveCamera: false})
. I'm curious though - what's your use-case for this? Why do you want to prevent students from moving the canvas around? If you'd rather not respond in public, feel free to email me: alex at tldraw.comto prevent the drawing tool being pressure sensitive, you can switch from the 'draw' dash style to the
solid
one:editor.setStyleForNextShapes(DefaultDashStyle, 'solid')