Skip to content

Commit

Permalink
Merge pull request #1695 from CPatchane/fix/support_ctx_roundRect
Browse files Browse the repository at this point in the history
Add support for ctx.roundRect
  • Loading branch information
lavrton committed Jan 3, 2024
2 parents a8efcd5 + f6ccabb commit 48ae639
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var COMMA = ',',
'putImageData',
'quadraticCurveTo',
'rect',
'roundRect',
'restore',
'rotate',
'save',
Expand Down Expand Up @@ -586,6 +587,20 @@ export class Context {
rect(x: number, y: number, width: number, height: number) {
this._context.rect(x, y, width, height);
}
/**
* roundRect function.
* @method
* @name Konva.Context#roundRect
*/
roundRect(
x: number,
y: number,
width: number,
height: number,
radii: number | DOMPointInit | (number | DOMPointInit)[]
) {
this._context.roundRect(x, y, width, height, radii);
}
/**
* putImageData function.
* @method
Expand Down
1 change: 1 addition & 0 deletions test/unit/Context-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('Context', function () {
'arc',
'arcTo',
'rect',
'roundRect',
'ellipse',
'fill',
'stroke',
Expand Down

0 comments on commit 48ae639

Please sign in to comment.