Skip to content

Commit

Permalink
Add support for ctx.roundRect
Browse files Browse the repository at this point in the history
  • Loading branch information
CPatchane committed Dec 28, 2023
1 parent a8efcd5 commit 467147b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 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,18 @@ 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) {
if (this._context.roundRect) {
this._context.roundRect(x, y, width, height, radii);
} else {
this._context.rect(x, y, width, height);
}
}
/**
* 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 467147b

Please sign in to comment.