Drawing a 1px thick line in canvas creates a 2px thick line

前端 未结 8 1825
抹茶落季
抹茶落季 2020-12-08 04:01

In this jsfiddle there\'s a line with a lineWidth of 1.

http://jsfiddle.net/mailrox/9bMPD/350/

e.g:

ctx.lineWidth = 1;

How

8条回答
  •  广开言路
    2020-12-08 04:37

    Did you see the first hit on google? (search for canvas line width 1px). Though I have to admit this isn't exactly "clean" or "lean". Ferry Kobus' solution is much better. Then again: it sucks you need to use "half pixels" in the first place...

提交回复
热议问题