diff --git a/packages/tldraw/src/lib/shapes/draw/toolStates/Drawing.ts b/packages/tldraw/src/lib/shapes/draw/toolStates/Drawing.ts index 2fc0c33aa..b72b10d0c 100644 --- a/packages/tldraw/src/lib/shapes/draw/toolStates/Drawing.ts +++ b/packages/tldraw/src/lib/shapes/draw/toolStates/Drawing.ts @@ -177,7 +177,8 @@ export class Drawing extends StateNode { // have our own value for this. The inputs.isPen is only if the input is a regular // pen, like an iPad pen, which needs to trigger "pen mode" in order to avoid // accidental palm touches. We don't have to worry about that with styluses though. - const z = this.info.point.z === undefined ? 0.5 : this.info.point.z + const { z = 0.5 } = this.info.point + this.isPen = isPen this.isPenOrStylus = isPen || (z > 0 && z < 0.5) || (z > 0.5 && z < 1) @@ -304,8 +305,8 @@ export class Drawing extends StateNode { const { segments } = shape.props const { x, y, z } = this.editor.getPointInShapeSpace(shape, inputs.currentPagePoint).toFixed() - - const newPoint = { x, y, z: this.isPenOrStylus ? +(z! * 1.25).toFixed(2) : 0.5 } + const pressure = this.isPenOrStylus ? +(inputs.currentPagePoint.z! * 1.25).toFixed(2) : 0.5 + const newPoint = { x, y, z: pressure } switch (this.segmentMode) { case 'starting_straight': {