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

鼠标从元素上直接移出画布时,从鼠标移出位置进入画布并hover元素时,没有触发元素的mouseover事件。 #1035

Open
chuhezhe0807 opened this issue Oct 20, 2023 · 3 comments

Comments

@chuhezhe0807
Copy link

   当元素处在画布边缘时,从元素上直接移出画布,触发了mouseout事件,但是Handler中的局部变量this._hovered没有重置,导致下一次从鼠标移出位置hover进元素时由于this._hovered和lastHovered相同无法触发mouseover事件。
   
   除了自己监听画布容器的鼠标移出事件手动调用Handler@resize重置this._hovered外,还有什么好的处理方法吗?
@Jancheng-z
Copy link

Jancheng-z commented Oct 20, 2023 via email

@xiaofan10
Copy link

如何往rect中添加text,用下面这段代码测试报错,哪位大佬能指点下
var rect = new zrender.Rect({
shape: {
x: 50,
y: 50,
width: 100,
height: 100
},
style: {
fill: null,
stroke: '#000',
}
})
console.log(rect)
var text = new zrender.Text()
console.log(text)
rect.setTextContent(text)
zr.add(rect);

@xiaofan10
Copy link

sorry 找到原因了,调试时把源码注掉了。。。
ZRender.prototype.add = function (el) {
if (!el) {
return;
}
this.storage.addRoot(el);

    // el.addSelfToZr(this);
    // this.refresh();
};

如何往rect中添加text,用下面这段代码测试报错,哪位大佬能指点下 var rect = new zrender.Rect({ shape: { x: 50, y: 50, width: 100, height: 100 }, style: { fill: null, stroke: '#000', } }) console.log(rect) var text = new zrender.Text() console.log(text) rect.setTextContent(text) zr.add(rect);

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

3 participants