antvis/G6

带stroke的rect图形,阴影效果显示问题 #5236

zhuweileo posted onGitHub

Describe the bug

带有stroke属性时,阴影效果会浮现在rect 的 body上面,好像阴影是加在了描边上。 去掉stroke 后效果正常。

                   const rect = group.addShape('rect', {
                            attrs: {
                                x: nodeOrigin.x,
                                y: nodeOrigin.y,
                                width: 168,
                                height: 58,
                                lineWidth: 1,
                                fontSize: 12,
                                fill: '#fff',
                                radius: 10,
                                stroke: '#E8E9EC',
                                opacity: 1,

                                shadowColor: '#000',
                                shadowBlur: 1,
                                shadowOffsetX: 0,
                                shadowOffsetY: 10,
                                // ...rectConfig,
                            },

                        });

<img width="661" alt="image" src="https://github.com/antvis/G6/assets/22818403/2c7bc38d-7179-4550-845e-fc0b59205269">

Your Example Website or App

https://codesandbox.io/p/sandbox/musing-varahamihira-56snx4?file=%2Findex.js

Steps to Reproduce the Bug or Issue

不需要复现操作,直接可见

Expected behavior

期望带有描边时,阴影效果不被浮现在body上,和dom的阴影效果相似

Screenshots or Videos

No response

Platform

  • OS: [macOS]
  • Browser: [ Chrome]
  • Version: [e.g. 91.1]

Additional context

No response


hi @zhuweileo, welcome!

posted by github-actions[bot] over 1 year ago

Hi @zhuweileo, Please star this repo if you find it useful! Thanks :star:! 你好 @zhuweileo。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

你好,这是由于 G6 4.0 使用的底层渲染引擎限制的导致的,该问题后续不会得到解决,建议使用 G6 5.0 以避免此问题。

posted by Aarebecca over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests