We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
查询了html2canvas的issue,发现原因是因为字体设置了 font-variant: tabular-nums,于是在代码中查找该属性,并没有,然而在浏览器中查找到了该属性,原来是antd的样式里面有这个设置,至于font-variant是干啥的,字体研究太深奥了,不管他。 在body中设置font-variant为normal就ok了,同时也解决了字符错位问题。
font-variant: tabular-nums
由于传入的width和height使用了clientWidth取值,默认是取整的,因此白边的产生就是实际元素多出来的小数点。使用target.getBoundingClientRect().width.toFixed(2)替换clientWidth,因为元素默认保留后两位,所以fixed2,但是还有问题,因为这样得到的不是数值,是字符串,无法生效,因此在前面加个+使之变成数字即可。
target.getBoundingClientRect().width.toFixed(2)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
字体大小无法正常转化问题
查询了html2canvas的issue,发现原因是因为字体设置了
font-variant: tabular-nums
,于是在代码中查找该属性,并没有,然而在浏览器中查找到了该属性,原来是antd的样式里面有这个设置,至于font-variant是干啥的,字体研究太深奥了,不管他。在body中设置font-variant为normal就ok了,同时也解决了字符错位问题。
截图有白边问题
由于传入的width和height使用了clientWidth取值,默认是取整的,因此白边的产生就是实际元素多出来的小数点。使用
target.getBoundingClientRect().width.toFixed(2)
替换clientWidth,因为元素默认保留后两位,所以fixed2,但是还有问题,因为这样得到的不是数值,是字符串,无法生效,因此在前面加个+使之变成数字即可。The text was updated successfully, but these errors were encountered: