I'm trying to draw different rectangular designs using setLineDash and lineDashOffset(HTML5 Canvas-2d Context). But Solid lines are drawn instead of dashed lines. Please help.
Points to be noted:
- Canvas Scaling is done.
- drawLine API is used for drawing lines.
- I'm using different integer points to draw lines.
- setLineDash([3,2]). Strictly, dashed thickness is "3" and space between them is "2" should be used.
`
this.context.setLineDash([3,2]);
this.context.lineDashOffset = 2;
drawLine(300,9.5,570,10);
drawLine(300,9.5,300,100);
drawLine(300,99.5,570,100);
drawLine(570,9.5,570,100);`
My Complete code for your reference: Codepen Link
Inspired from: Document Link

drawLinein your question, since this was actually where the problem came from. - Kaiido