Closed QmagicianEX closed 6 months ago
可以通过穿透路径获取:
没有效果,好像加了穿透属性还是只获取到了上层元素,是不是我的参数传的有问题
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里面有,谢了。