5
Vote

Vertex Dragging is very over sensitive.

description

It is very difficult to drag a vertex around the GraphLayout.

If the item being dragged is moved near the edge of the established graph, it appears to shoot off in one direction or another, making it very hard to place the items accurately.

comments

olipoopo wrote Mar 21, 2013 at 8:50 AM

in the dragbehavior.cs
 private static void OnDragging(object sender, MouseEventArgs e)
        {
            if (sender != null)
            {
                var obj = sender as DependencyObject;
                if (obj == null) return;

                if (!GetIsDragging(obj))
                {
                    return;
                }

                Point pos = e.GetPosition(obj as IInputElement);
                double horizontalChange = (pos.X - GetOriginalX(obj))*_scale.X;
                double verticalChange = (pos.Y - GetOriginalY(obj))*_scale.Y;

                if (double.IsNaN(GetX(obj)))
                {
                    SetX(obj, 0);
                }
                if (double.IsNaN(GetY(obj)))
                {
                    SetY(obj, 0);
                }


               if (GetX(obj) < 0)
                    horizontalChange /=30;

                if (GetY(obj) < 0)
                    verticalChange /= 30;

                if (GetX(obj) > 0)
                    horizontalChange /= 10;

                if (GetY(obj) > 0)
                    verticalChange /= 10;
                SetX(obj, GetX(obj)+ horizontalChange);
                SetY(obj, GetY(obj)+ verticalChange);
             
            }

            e.Handled = true;
        }