mxGraph: Which event is fired when I move a handle point of an edge?

时光毁灭记忆、已成空白 提交于 2021-02-08 06:57:21

问题


I move the point and I want to save the position after the movement. How can I catch this event? I know, the edge gets the points after moving, I can find control points in the geometry. But I need the moment of the end of movement.


回答1:


I'm not sure if it helps, but I usually have a listener to mxEvent.CHANGE, and process each change...

Something like this:

model.addListener(mxEvent.CHANGE, function(sender, evt)
{
   var changes = evt.getProperty('edit').changes;
   for (var i = 0; i < changes.length; i++) {   
     if (changes[i].constructor.name ==  "mxTerminalChange") {
       // DO SOMETHING
     }
   }
}


来源:https://stackoverflow.com/questions/62469751/mxgraph-which-event-is-fired-when-i-move-a-handle-point-of-an-edge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!