在html5画布上显示不正确的lineWidth = 1 [英] incorrect display lineWidth=1 at html5 canvas

查看:521
本文介绍了在html5画布上显示不正确的lineWidth = 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有示例:


I have example: https://developer.mozilla.org/samples/canvas-tutorial/4_5_canvas_linewidth.html But first line is not equals 1 pixel: How can i fix this? (browser Google Chrome)

解决方案

Always add 0.5 pixel to the position of your line to prevent the anti-aliasing.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Applying_styles_and_colors#A_lineWidth_example

这篇关于在html5画布上显示不正确的lineWidth = 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆