HTML Canvas provides methods for drawing rectangles, fillRect() and strokeRect(), but I can’t find a method for making rectangles with rounded corners. How can I do that?
HTML Canvas provides methods for drawing rectangles, fillRect() and strokeRect() , but I can’t
Share
The HTML5 canvas doesn’t provide a method to draw a rectangle with rounded corners.
How about using the
lineTo()andarc()methods?You can also use the
quadraticCurveTo()method instead of thearc()method.