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

在手机浏览器上无法更换绘图工具 #5

Open
HViktorTsoi opened this issue Jan 13, 2018 · 1 comment
Open

在手机浏览器上无法更换绘图工具 #5

HViktorTsoi opened this issue Jan 13, 2018 · 1 comment

Comments

@HViktorTsoi
Copy link

在手机浏览器上DEBUG发现,切换工具之后,canvas.js中currentTool指向的还是currentToolContainer初始化时的tool引用,原因是在正常的非移动版本中(检测的是mouseenter事件),有如下一段代码:

$document.delegate('#canvas-mouse', 'mouseenter', function(e){
                mouseCanvas.clear();
                //更新当前工具
                currentTool = global.painter.tool.currentToolContainer.getTool();
});

而移动版本监听touch事件时没有这段,在touchstart事件处理器末尾加入如下代码:
currentTool = global.painter.tool.currentToolContainer.getTool();
之后在手机浏览器上可以正常切换工具了。

@yanhaijing
Copy link
Owner

有兴趣提个pr吗

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