You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is that if you're using a pen (e.g. Surface Pen) then the canvas will enter drawing mode automatically.
This does work - up to a point. You touch the pen to the surface, it draws a beautiful line and then disengages drawingMode again upon removing the pen.
However, when you then try to draw a second line (or use your mouse/finger to select something) the canvas will be erased. If you set the drawingMode after the click on a button or something (like in the demo), the canvas will not be erased.
This is somewhat sub-optimal and I'm not sure where this is coming from.
If you don't have a pen you can easily simulate this by doing if(e.pointerType === "mouse")instead.
The text was updated successfully, but these errors were encountered:
After some more tries, I found the source of the problem: Basically, the pointerUp event fires first which sets the DrawingMode to false. Which in turn seems to prevent the canvas from "finalizing" the drawn path - i.e. while it gets drawn, it's not stored persistently.
Code basically looks like this:
and
The idea is that if you're using a pen (e.g. Surface Pen) then the canvas will enter drawing mode automatically.
This does work - up to a point. You touch the pen to the surface, it draws a beautiful line and then disengages drawingMode again upon removing the pen.
However, when you then try to draw a second line (or use your mouse/finger to select something) the canvas will be erased. If you set the drawingMode after the click on a button or something (like in the demo), the canvas will not be erased.
This is somewhat sub-optimal and I'm not sure where this is coming from.
If you don't have a pen you can easily simulate this by doing
if(e.pointerType === "mouse")
instead.The text was updated successfully, but these errors were encountered: