Closed mbostock closed 5 years ago
resetTransform() should not be monkeypatched. When using drawImage() to combine multiple canvas outputs into one, the target canvas context must not have any transforms. Otherwise any source image/canvas will be scaled. Calling resetTransform() on the output canvas is the only way to prevent this without losing the convenience of using DOM.context2d().
I've created a simplified example here: http://jsfiddle.net/0v9g3x8k/
If you use DOM.context2d when dpi is not 1, you probably never want to say:
Instead you want to say
Do we want to monkey-patch context.resetTransform on the returned instance to do this automatically? Or is calling context.resetTransform considered user error?