Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README.md fix getOutlinePoints => getStrokeOutlinePoints #84

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update README.md fix getOutlinePoints => getStrokeOutlinePoints
README.md contained incorrect reference to getOutlinePoints, which is actually exported as getStrokeOutlinePoints.
mattclarkestudio authored Sep 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit eaf249e53f0aefd599ae6bb108c5eb11c8d93643
6 changes: 3 additions & 3 deletions packages/perfect-freehand/README.md
Original file line number Diff line number Diff line change
@@ -218,17 +218,17 @@ import samplePoints from "./samplePoints.json'
const strokePoints = getStrokePoints(samplePoints)
```

#### `getOutlinePoints`
#### `getStrokeOutlinePoints`

A function that accepts an array of points (formatted as `{ point, pressure, vector, distance, runningLength }`, i.e. the output of `getStrokePoints`) and (optionally) an options object, and returns an array of points (`[x, y]`) defining the outline of a pressure-sensitive stroke.

```js
import { getStrokePoints, getOutlinePoints } from 'perfect-freehand'
import { getStrokePoints, getStrokeOutlinePoints } from 'perfect-freehand'
import samplePoints from "./samplePoints.json'

const strokePoints = getStrokePoints(samplePoints)

const outlinePoints = getOutlinePoints(strokePoints)
const outlinePoints = getStrokeOutlinePoints(strokePoints)
```

**Note:** Internally, the `getStroke` function passes the result of `getStrokePoints` to `getStrokeOutlinePoints`, just as shown in this example. This means that, in this example, the result of `outlinePoints` will be the same as if the `samplePoints` array had been passed to `getStroke`.