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

[g-canvas] Path 拾取区域有问题 #952

Closed
xiaoiver opened this issue Apr 12, 2022 · 0 comments
Closed

[g-canvas] Path 拾取区域有问题 #952

xiaoiver opened this issue Apr 12, 2022 · 0 comments
Assignees
Labels

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Apr 12, 2022

复现方法,未闭合的 Path,鼠标移动到内部也触发了拾取判定:
https://g-next.antv.vision/zh/examples/shape#path

解决方案是提供 pointer-events 属性,目前的 interactive: false 等同于 pointer-events: 'none'
https://developer.mozilla.org/zh-CN/docs/Web/CSS/pointer-events

除此之外,pointer-events 还可以提供更精细的控制,毕竟是否能够响应交互事件会受到多个属性影响:

  • visibility 元素可见性是否可以影响拾取
  • fill stroke 如果设置为 'none' 是否影响拾取,另外有时我们只想拾取边框而非填充区域

目前 g-canvas/svg 已经修复,g-webgl 还需要修改。

@xiaoiver xiaoiver added the bug label Apr 12, 2022
@xiaoiver xiaoiver self-assigned this Apr 12, 2022
xiaoiver added a commit that referenced this issue Apr 28, 2022
* fix: test whether native event came from context's dom element #928

* fix: add offscreenCanvas in Canvas config  #940

* feat: add CSS API, includes CSS Typed OM & Layout API

* fix: add shadow for Line / Polyline / Path #959

* feat: add  for multiple-layer picking #948

* fix: put raf/cancelRaf to Canvas #953

* fix: add limits query such as  to Canvas #953

* fix: account for 'none' value in <color> #952

* feat: support multi-layer picking in g-webgl #948

* fix: support  when picking in g-webgl #952

* feat: support inheritance in style system

* fix: encode html entity in g-svg #963

* feat: add get/setLocalMatrix for legacy G4.0

* fix: animations example

* feat: add pointerEvents property #942

* fix: skip number2string when parsing number

* Publish

 - @antv/g-canvas@1.0.20
 - @antv/g-components@1.0.18
 - @antv/g-devtool@0.3.4
 - @antv/g-math@1.0.18
 - @antv/g-mobile-canvas@0.0.2
 - @antv/g-mobile-svg@0.0.2
 - @antv/g-mobile-webgl@0.0.2
 - @antv/g-mobile@1.0.5
 - @antv/g-plugin-3d@1.0.22
 - @antv/g-plugin-box2d@1.0.11
 - @antv/g-plugin-canvas-picker@1.0.18
 - @antv/g-plugin-canvas-renderer@1.0.18
 - @antv/g-plugin-control@1.0.19
 - @antv/g-plugin-css-select@1.0.18
 - @antv/g-plugin-dom-interaction@1.0.18
 - @antv/g-plugin-gpgpu@1.0.19
 - @antv/g-plugin-html-renderer@1.0.19
 - @antv/g-plugin-matterjs@1.0.8
 - @antv/g-plugin-mobile-interaction@0.0.7
 - @antv/g-plugin-physx@1.0.11
 - @antv/g-plugin-svg-picker@1.0.18
 - @antv/g-plugin-svg-renderer@1.0.18
 - @antv/g-plugin-webgl-renderer@1.0.24
 - @antv/g-plugin-yoga@1.0.8
 - @antv/g-shader-components@1.0.16
 - @antv/g-svg@1.0.18
 - @antv/g-web-component@1.0.5
 - @antv/g-webgl@1.0.24
 - @antv/g-webgpu-compiler@1.0.19
 - @antv/g@5.0.21
 - @antv/react-g@1.0.14
 - @antv/g-site@1.0.24

* publish

Co-authored-by: yuqi.pyq <yuqi.pyq@antgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant