All three properties.
You want to setSize
to resize the canvas, and you want to make the coordinate space (the "inner size" of the canvas) the same as its size (its "external size"), or within the same ratio as before the resize.
If you start with a 300×200 canvas with a 300×200 coordinate space (so that a pixel in Context2D
maps to a CSS pixel) and you need to resize the canvas to 600×400, then set you want to set the coordinate space to 600×400 too to keep the 1 canvas pixel == 1 CSS pixel ratio.