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

感谢作者, 非常好的参考, 跟着做的时候发现一个小问题 #15

Open
rbg001 opened this issue Apr 18, 2020 · 1 comment
Open

Comments

@rbg001
Copy link

rbg001 commented Apr 18, 2020

当鼠标进入节点, 并悬浮在outPoint上时, 会设置填充色, 但是当鼠标离开outPoint,但是没有离开Node时, 填充色没有被取消, 这是一个小小问题.

自定义行为中:
behavior/hover-node.js 里面做如下修改就可以了

  if (e.target.attrs.isOutPointOut || e.target.attrs.isOutPoint) {
    ...
   } else {
      // 如果鼠标悬浮在node上, 但目标不是out点, 移除点的填充色
      group.find(g => {
        if (g.attrs.isInPoint || g.attrs.isOutPoint) {
          g.attr('fill', '#fff')
        }
      })
    }
@caoyu48
Copy link
Owner

caoyu48 commented Dec 18, 2020

厉害,加油

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