1

After I draw a line on canvas I scale document (with CTRL+Wheel), as it turned out, a line is raster and it looks pretty ugly after scaling. How can I solve the issue? Is there something better then redrawing each time when document is scaled?

Thank you in advance!

Eugeny89
  • 3,797
  • 7
  • 51
  • 98

1 Answers1

3

If you can only use the canvas element, there is no other way to display a sharp line, than redrawing it when zooming. This is because the canvas doesn't support vector graphics.

Svg could be a option, if you're able to use a different technology.

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
  • 1
    +1 for SVG. It's a really underappreciated technology. Most people don't realize that SVGs can be procedurally generated and manipulated through javascript just like you can work with a canvas, and it is even more widely available. – Philipp Dec 12 '12 at 09:28
  • 1
    You've got some options [here](http://stackoverflow.com/questions/588718/jquery-svg-vs-raphael) – Cerbrus Dec 12 '12 at 10:19
  • @Cerbus,Thank you for your answer! – Eugeny89 Dec 12 '12 at 10:29