make rectangle rounded using canvas [duplicate]
make rectangle rounded using canvas [duplicate]
This question already has an answer here:
I make a rectangle , but I want to make it rounded , how can I do that ??
context.fillStyle = theme.line.strokeColor;
context.fillRect((point1.x + point2.x - width) / 2, (point1.y + point2.y - 18) / 2, width,parseInt('12px arial', 15));
context.fillStyle = '#FFFFFF';
context.fillText(number, ((point1.x + point2.x - width) / 2) + 3, ((point1.y + point2.y - 15) / 2));
here is my rectangle :
I want it to be like this :
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.