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

f2-wx插件Legend无法点击 #1517

Closed
1 task
syory-ken opened this issue Jun 15, 2022 · 0 comments
Closed
1 task

f2-wx插件Legend无法点击 #1517

syory-ken opened this issue Jun 15, 2022 · 0 comments
Assignees

Comments

@syory-ken
Copy link

syory-ken commented Jun 15, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/syory-ken/f2-wx-bug-demo

Steps to reproduce

  1. 运行demo。
  2. 点击Legend即可复现。
Environment Info
f2 4.0.23
System macOS 12.3.1
Browser -

问题原因

小程序 e.detail 返回的x,y是点击位置和顶部的距离,与getBBox返回x,y相对距离不一致,导致位置判断错误。

问题代码

event.touches = [e.detail];

解决方法

将 e.detail.x,y 分别减去e.target.offsetLeft、offsetTop

event.touches = [{
    x: e.detail.x - e.target.offsetLeft,
    y: e.detail.y - e.target.offsetTop
}];
@syory-ken syory-ken changed the title 微信小程序f2插件Legend无法点击 f2-wx插件Legend无法点击 Jun 15, 2022
@zengyue zengyue self-assigned this Jun 15, 2022
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