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-svg] Text 应用 clipPath 之后拾取范围有误 #961

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

[g-svg] Text 应用 clipPath 之后拾取范围有误 #961

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

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Apr 21, 2022

对下面的 <text> 应用一个 clipPath 之后,展示效果没问题,但鼠标移动到被裁减区域依然变换了样式:

<svg viewBox="0 0 100 100">
  <clipPath id="myClip">
    <circle cx="40" cy="35" r="5"></circle>
  </clipPath>

  <text x="40" y="40" clip-path="url(#myClip)" style="cursor: move;">xxxxxxxxxxxx
</text>
</svg>

Apr-21-2022 22-17-53

同样,此时调用 DOM API:elementFromPoint 也会拾取到被裁减区域。测试后发现只有 <text> 有这样的表现,其他图形例如 <circle> <path> 都正常。

修复方案(待验证)将 clip-path 应用在 <text> 的父元素上。

@xiaoiver xiaoiver added the bug label Apr 21, 2022
@xiaoiver xiaoiver self-assigned this Apr 21, 2022
xiaoiver added a commit that referenced this issue May 3, 2022
xiaoiver added a commit that referenced this issue May 3, 2022
* feat: support applying zoom in camera animation #964

* feat: tolerate duration in goToLandmark

* fix: test case for landmark

* fix: use syringe defined token

* Publish

 - @antv/g-canvas@1.0.21-alpha.0
 - @antv/g-components@1.0.19-alpha.0
 - @antv/g-devtool@0.3.5-alpha.0
 - @antv/g-math@1.0.19-alpha.0
 - @antv/g-mobile-canvas@0.0.3-alpha.0
 - @antv/g-mobile-svg@0.0.3-alpha.0
 - @antv/g-mobile-webgl@0.0.3-alpha.0
 - @antv/g-mobile@1.0.6-alpha.0
 - @antv/g-plugin-3d@1.0.23-alpha.0
 - @antv/g-plugin-box2d@1.0.12-alpha.0
 - @antv/g-plugin-canvas-picker@1.0.19-alpha.0
 - @antv/g-plugin-canvas-renderer@1.0.19-alpha.0
 - @antv/g-plugin-control@1.0.20-alpha.0
 - @antv/g-plugin-css-select@1.0.19-alpha.0
 - @antv/g-plugin-dom-interaction@1.0.19-alpha.0
 - @antv/g-plugin-gpgpu@1.0.20-alpha.0
 - @antv/g-plugin-html-renderer@1.0.20-alpha.0
 - @antv/g-plugin-matterjs@1.0.9-alpha.0
 - @antv/g-plugin-mobile-interaction@0.0.8-alpha.0
 - @antv/g-plugin-physx@1.0.12-alpha.0
 - @antv/g-plugin-svg-picker@1.0.19-alpha.0
 - @antv/g-plugin-svg-renderer@1.0.19-alpha.0
 - @antv/g-plugin-webgl-renderer@1.0.25-alpha.0
 - @antv/g-plugin-yoga@1.0.9-alpha.0
 - @antv/g-shader-components@1.0.17-alpha.0
 - @antv/g-svg@1.0.19-alpha.0
 - @antv/g-web-component@1.0.6-alpha.0
 - @antv/g-webgl@1.0.25-alpha.0
 - @antv/g-webgpu-compiler@1.0.20-alpha.0
 - @antv/g@5.0.22-alpha.0
 - @antv/react-g@1.0.15-alpha.0
 - @antv/g-site@1.0.25-alpha.0

* fix: try to resolve  in codesandbox

* Publish

 - @antv/g-canvas@1.0.21-alpha.1
 - @antv/g-components@1.0.19-alpha.1
 - @antv/g-math@1.0.19-alpha.1
 - @antv/g-mobile-canvas@0.0.3-alpha.1
 - @antv/g-mobile-svg@0.0.3-alpha.1
 - @antv/g-mobile-webgl@0.0.3-alpha.1
 - @antv/g-mobile@1.0.6-alpha.1
 - @antv/g-plugin-3d@1.0.23-alpha.1
 - @antv/g-plugin-box2d@1.0.12-alpha.1
 - @antv/g-plugin-canvas-picker@1.0.19-alpha.1
 - @antv/g-plugin-canvas-renderer@1.0.19-alpha.1
 - @antv/g-plugin-control@1.0.20-alpha.1
 - @antv/g-plugin-css-select@1.0.19-alpha.1
 - @antv/g-plugin-dom-interaction@1.0.19-alpha.1
 - @antv/g-plugin-gpgpu@1.0.20-alpha.1
 - @antv/g-plugin-html-renderer@1.0.20-alpha.1
 - @antv/g-plugin-matterjs@1.0.9-alpha.1
 - @antv/g-plugin-mobile-interaction@0.0.8-alpha.1
 - @antv/g-plugin-physx@1.0.12-alpha.1
 - @antv/g-plugin-svg-picker@1.0.19-alpha.1
 - @antv/g-plugin-svg-renderer@1.0.19-alpha.1
 - @antv/g-plugin-webgl-renderer@1.0.25-alpha.1
 - @antv/g-plugin-yoga@1.0.9-alpha.1
 - @antv/g-shader-components@1.0.17-alpha.1
 - @antv/g-svg@1.0.19-alpha.1
 - @antv/g-web-component@1.0.6-alpha.1
 - @antv/g-webgl@1.0.25-alpha.1
 - @antv/g-webgpu-compiler@1.0.20-alpha.1
 - @antv/g@5.0.22-alpha.1
 - @antv/react-g@1.0.15-alpha.1

* feat: support more camera types(orbiting, exploring, tracking) #964

* chore: add more test cases

* chore: add badges

* fix: apply clipPath to  in g-svg #961

Co-authored-by: yuqi.pyq <yuqi.pyq@antgroup.com>
@xiaoiver xiaoiver closed this as completed May 3, 2022
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