CSS 中的圆圈 div 未正确显示在 canvas 中
Circle div in CSS doesn't show in canvas properly
我正在使用 html2canvas 0.5.0 alpha1,我在 div 中添加了一些圆圈,我想用这个 CSS 发送到 canvas :
.circle {高度:20px;宽度:20px;边界半径:20px;位置:绝对;顶部:-8px;}
http://www.awesomescreenshot.com/image/297705/8c3f811182dc5a909c9c1cbd270dabd2
在 chrome/safari 上看起来像这样,圆圈渲染得不好。
虽然在 Firefox 上运行良好。
任何人都知道修复 canvas 上的圆圈外观的方法吗?
border-radius
必须是 width/height 的一半。所以将它设置为 10px
– 甚至更好 50%
将呈现一个平滑的圆:
div {
width: 20px;
height: 20px;
border-radius: 50%;
background: red;
}
我正在使用 html2canvas 0.5.0 alpha1,我在 div 中添加了一些圆圈,我想用这个 CSS 发送到 canvas : .circle {高度:20px;宽度:20px;边界半径:20px;位置:绝对;顶部:-8px;}
http://www.awesomescreenshot.com/image/297705/8c3f811182dc5a909c9c1cbd270dabd2 在 chrome/safari 上看起来像这样,圆圈渲染得不好。
虽然在 Firefox 上运行良好。 任何人都知道修复 canvas 上的圆圈外观的方法吗?
border-radius
必须是 width/height 的一半。所以将它设置为 10px
– 甚至更好 50%
将呈现一个平滑的圆:
div {
width: 20px;
height: 20px;
border-radius: 50%;
background: red;
}