leaferjs / leafer-ui

一款好用的 Canvas 引擎,革新的开发体验,用于高效绘图 、UI 交互、图形编辑。A user-friendly Canvas engine with a revolutionary development experience, for efficient drawing, UI interactions, and graphic editing.
https://www.leaferjs.com
MIT License
2.56k stars 91 forks source link

如何获取到框选的的边界的x,y的位置呢 #228

Closed daLeiStrive closed 1 month ago

daLeiStrive commented 1 month ago

const { width, height, x, y } = leafer.editor.editBox.rect 如上代码发现x y 都是 0 只能获取宽高

e99896e04b856fc0c5987cb623caca5

leaferjs commented 1 month ago

可以通过editor.element.x 获取,或通过包围盒获取: https://www.leaferjs.com/ui/reference/property/bounds.html

daLeiStrive commented 1 month ago

好的,感谢感谢