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
移动端px转mm需求:
The text was updated successfully, but these errors were encountered:
已经转发到6个群里了~
Sorry, something went wrong.
draw函数中gap控制单位长度,是像素值,textValue控制显示单位的文本,调整这两个变量即可。 举例:以 10mm 为单位长度渲染标尺,假定 1mm = 3.78px。gap = (this.getGap(zoom) / 100) * 3.78 * 10,textValue = ((startValue + pos) / 3.78).toFixed(0)即可。 补充说明:getGap函数当 zoom = 1 时返回值是 100。 补充提示:1. 左上角单位;2. 数值计算精度。
draw
gap
textValue
gap = (this.getGap(zoom) / 100) * 3.78 * 10
textValue = ((startValue + pos) / 3.78).toFixed(0)
getGap
100
大佬好使,顶礼膜拜!!!
No branches or pull requests
移动端px转mm需求:
个人实现:曾自己实现一版只是改了源码部分draw方法,没有考虑缩放等因素(对于源码理解不透彻导致),导致滚动条没有随画布滚动而滚动。
期望:在现有卡尺效果的基础上,将px转mm即可
The text was updated successfully, but these errors were encountered: