[fix] Drawing tool touch for first pen mark (#1977)
This PR fixes a bug where a touch from a palm received at the start of a drawing operation, when that operation was the first entry into pen mode, would cause the line to fail. ### Change Type - [x] `patch` — Bug fix ### Test Plan 1. On an iPad with a pencil, select the draw tool. Ensure that you're not yet in pen mode. 2. Place your palm on the iPad and immediately place the pencil on the screen. 3. Previously, you would get a line between your palm and the pencil point. Now, you should get only the pencil point. ### Release Notes - [fix] Accidental palm inputs when using iPad pencil
This commit is contained in:
parent
0d21e8aad2
commit
852187058a
1 changed files with 11 additions and 7 deletions
|
@ -69,14 +69,18 @@ export class Drawing extends StateNode {
|
||||||
// The user made a palm gesture before starting a pen gesture;
|
// The user made a palm gesture before starting a pen gesture;
|
||||||
// ideally we'd start the new shape here but we could also just bail
|
// ideally we'd start the new shape here but we could also just bail
|
||||||
// as the next interaction will work correctly
|
// as the next interaction will work correctly
|
||||||
this.cancel()
|
if (this.markId) {
|
||||||
|
this.editor.bailToMark(this.markId)
|
||||||
|
this.startShape()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
// If we came in from a menu but have no started dragging...
|
// If we came in from a menu but have no started dragging...
|
||||||
if (!this.canDraw && inputs.isDragging) {
|
if (!this.canDraw && inputs.isDragging) {
|
||||||
this.startShape()
|
this.startShape()
|
||||||
this.canDraw = true // bad name
|
this.canDraw = true // bad name
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.canDraw) {
|
if (this.canDraw) {
|
||||||
// Don't update the shape if we haven't moved far enough from the last time we recorded a point
|
// Don't update the shape if we haven't moved far enough from the last time we recorded a point
|
||||||
|
|
Loading…
Reference in a new issue