Handle view size and transformation correctly when exporting SVG.

Closes #277.