LogicFlow icon indicating copy to clipboard operation
LogicFlow copied to clipboard

使用react-dnd拖拽,如果将页面的客户端坐标转换画布本地坐标?急急急

Open chengjiashuai opened this issue 3 years ago • 3 comments

类似于antv X6的clientToLocal()方法

chengjiashuai avatar Sep 22 '22 06:09 chengjiashuai

在lf.graphModel.transformModel中有HtmlPointToCanvasPointCanvasPointToHtmlPoint。lf.graphModel上也有getPointByClient. http://logic-flow.org/api/graphModelApi.html#getpointbyclient http://logic-flow.org/api/transformModelApi.html#zoom-zoomsize-point

towersxu avatar Sep 22 '22 06:09 towersxu

HtmlPointToCanvasPoint试了一下,并不能解决我的问题,我的目的是想要把react-dnd拖放的浏览器坐标转换成画布坐标

chengjiashuai avatar Sep 22 '22 07:09 chengjiashuai

getPointByClient也不行吗?

towersxu avatar Sep 23 '22 03:09 towersxu

解决了,多谢

chengjiashuai avatar Sep 26 '22 03:09 chengjiashuai