I am experimenting to use MouseDragged
eventhandler to change the vertices positions of a triangle, it works, but not as smooth as using Locators. Is this the correct way to handle mouse dragging? Would someone please help to improve the response speed.
DynamicModule[{ pos1 = {1, 0}/2 , pos2 = {1, 1}/2 , pos3 = {-1, 0}/2},
edglst = { 1 <-> 2 , 2 <-> 3 , 3 <-> 1 };
Dynamic@Graph[
{ EventHandler[1, {"MouseDragged" :> (pos1 = MousePosition["Graphics"])}],
EventHandler[2, {"MouseDragged" :> (pos2 = MousePosition["Graphics"])}],
EventHandler[3, {"MouseDragged" :> (pos3 = MousePosition["Graphics"])}]} ,
edglst,
VertexCoordinates -> {pos1, pos2, pos3 } ,
VertexSize -> 0.08, VertexLabels -> "Name",
PlotRange -> 1, EdgeStyle -> {Thick}, ImagePadding -> 10]]