Skip to content

Commit

Permalink
Fix options for Path.offset
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed Feb 27, 2024
1 parent 3f43258 commit 9df673a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1536,11 +1536,15 @@ export namespace Path {
export const toC = toCubicBezier

export interface OffsetOptions {
/**
* The cap style of offset path
*/
cap?: PaperOffsetOptions['cap']
/**
* The join style of offset path
* @defaultValue 'miter'
*/
lineJoin?: CanvasLineJoin
join?: CanvasLineJoin
/**
* The limit for miter style
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit
Expand Down Expand Up @@ -1572,7 +1576,8 @@ export namespace Path {
const paperPath = toPaperPath(path)

const _options: PaperOffsetOptions = {
join: options?.lineJoin,
cap: options?.cap,
join: options?.join,
limit: options?.miterLimit,
}

Expand Down Expand Up @@ -1610,7 +1615,7 @@ export namespace Path {
const paperPath = toPaperPath(path)

const _options: PaperOffsetOptions = {
join: options?.lineJoin,
join: options?.join,
cap: options?.lineCap,
limit: options?.miterLimit,
}
Expand Down

0 comments on commit 9df673a

Please sign in to comment.