How can I reset the scale of a canvas' context?
scale
will multiply the current transform matrix by a scale matrix, so indeed, these scale factors multiply. You can use the state stack to save and restore the current transform:
context.save();
context.scale(2, 2);
... // anything drawn here is twice as big
context.restore();
Alternatively, you can reset the transform by loading the identity matrix directly:
context.scale(2, 2);
...
context.setTransform(1, 0, 0, 1, 0, 0);
The following method is clearer, however it is experimental. That is to say everything except IE and Edge support it.
context.resetTransform();
As of 2019 the sensible option is still:
ctx.setTransform(1, 0, 0, 1, 0, 0);
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/resetTransform#Browser_compatibility