Adds pressure to pointer data

This commit is contained in:
Steve Ruiz 2021-06-05 17:57:29 +01:00
parent 81141e7bb5
commit 72accc5f44
2 changed files with 8 additions and 8 deletions

View file

@ -165,9 +165,9 @@ function renderPath(shape: DrawShape, style: ShapeStyles) {
getSvgPathFromStroke(
getStroke(shape.points, {
size: 1 + +styles.strokeWidth * 2,
thinning: 0.83,
end: { taper: +styles.strokeWidth * 16 },
start: { taper: +styles.strokeWidth * 16 },
thinning: 0.85,
end: { taper: +styles.strokeWidth * 20 },
start: { taper: +styles.strokeWidth * 20 },
})
)
)

View file

@ -61,8 +61,8 @@ class Inputs {
const info = {
target,
pointerId: e.pointerId,
origin: [e.clientX, e.clientY],
point: [e.clientX, e.clientY],
origin: [e.clientX, e.clientY, e.pressure],
point: [e.clientX, e.clientY, e.pressure],
shiftKey,
ctrlKey,
metaKey: isDarwin() ? metaKey : ctrlKey,
@ -81,8 +81,8 @@ class Inputs {
const info = {
target,
pointerId: e.pointerId,
origin: [e.clientX, e.clientY],
point: [e.clientX, e.clientY],
origin: [e.clientX, e.clientY, e.pressure],
point: [e.clientX, e.clientY, e.pressure],
shiftKey,
ctrlKey,
metaKey: isDarwin() ? metaKey : ctrlKey,
@ -100,7 +100,7 @@ class Inputs {
const info = {
...prev,
pointerId: e.pointerId,
point: [e.clientX, e.clientY],
point: [e.clientX, e.clientY, e.pressure],
shiftKey,
ctrlKey,
metaKey: isDarwin() ? metaKey : ctrlKey,