【发布时间】:2019-12-24 16:00:00
【问题描述】:
我正在尝试canvas,但我无法让线条变细。
我用的是lineWidth as .5,但还是太粗了。
const c = canvas.getContext('2d');
canvas.width = this.track.width();
canvas.height = 18;
c.beginPath()
c.moveTo(where, 20)
c.lineTo(where, 20)
c.lineTo(where, 0)
// If i go .4 the line starts having opacity
c.lineWidth = .5;
c.stroke()
没有解决办法吗?
这就是我的网格的样子
【问题讨论】:
-
您的图片无效(禁止)。
-
像素不能小于 1 像素。有其他事情发生,请使用 JSFiddle 更新您的问题
-
将颜色更改为透明的。这会显得更薄
标签: javascript html canvas