mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Add support for ctx.roundRect
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
This commit is contained in:
parent
a8efcd554a
commit
467147b4c7
@ -58,6 +58,7 @@ var COMMA = ',',
|
||||
'putImageData',
|
||||
'quadraticCurveTo',
|
||||
'rect',
|
||||
'roundRect',
|
||||
'restore',
|
||||
'rotate',
|
||||
'save',
|
||||
@ -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
|
||||
|
@ -22,6 +22,7 @@ describe('Context', function () {
|
||||
'arc',
|
||||
'arcTo',
|
||||
'rect',
|
||||
'roundRect',
|
||||
'ellipse',
|
||||
'fill',
|
||||
'stroke',
|
||||
|
Loading…
Reference in New Issue
Block a user