Skip to content
New issue

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

移动端图片不能平铺 #4

Closed
juxiu opened this issue Apr 25, 2018 · 5 comments
Closed

移动端图片不能平铺 #4

juxiu opened this issue Apr 25, 2018 · 5 comments

Comments

@juxiu
Copy link

juxiu commented Apr 25, 2018

设置图片之后,图片宽高比canvas宽高大

@94cstyles
Copy link
Owner

你是说的那个 刮刮卡 setResult ? 这个是设置背景,你使用 background-sizebackground-repeat 控制

@juxiu
Copy link
Author

juxiu commented Apr 26, 2018

感谢作者回复,不是setResult,是刮刮卡的涂层,new Img之后传进去,图片不能百分百填充canvas画布,图片比画布要大许多,只显示图片的一部分。

@juxiu
Copy link
Author

juxiu commented Apr 26, 2018

还有个问题,当文档高度超出可视区域,文档向上滑动之后,绘制起点的位置有偏差

@94cstyles
Copy link
Owner

推荐你fork一份,在这里对代码进行修改。需要你添加新的参数,修改drawImage。
或者你不想修改源码,你可以创建一个canvas对图像进行调整大小然后转换为base64,再创建Image传递过来。

@juxiu
Copy link
Author

juxiu commented Apr 26, 2018

感谢,改了源码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants