leaferjs/leafer-ui

上层元素遮住下层元素的情况,应该怎么鼠标移入选中呢?

Closed this issue · 4 comments

没有效果,好像加了穿透属性还是只获取到了上层元素,是不是我的参数传的有问题

        const leafer = new Leafer({ view: window })
        const ellipse = new Ellipse({ id: 'block', fill: 'black' })
        const rect = new Rect({ fill: '#32cd79' })
        leafer.add(ellipse)
        leafer.add(rect)
        console.log(
          leafer.pick({ x: 20, y: 20 }, {through: true})
        )

坐标传{x:50,y:50}再看看,另外结果需要你自己通过返回数据中的throughPath 查找,那是一个从下往上找到的元素顺序列表

可以,throughPath里面有,谢了。