I don’t understand why the following code snippets produce different results because css will scale the canvas as it has been enlarged,
<style> #canvas { width: 800px; height: 600px; } </style> <canvas id="canvas"></canvas>
Unlike this approach (which works as expected):
<canvas id="canvas" width="800px" height="600px"></canvas>
css html5 canvas
Joaquín L. Robles Feb 17 2018-11-17T00: 00Z
source share