Begin Drag on more then 2 pixels

Hi there,
I want my Node to Drag only if they are 5 Pixels away from their original position, cause some users unlink them when double clicking cause of shaky hands.

Searching the forum leads my to override IsBeyondDragSize, but if I do so and try to drag the pan mouse cursor is showing up and no drag is happening.

Where is the mistake?

Did you override DraggingTool.IsBeyondDragSize?

Yes, and I removed the / 2 to achieve a greater distance.

    protected override bool IsBeyondDragSize()
    {
        Diagram diagram = this.Diagram;
        if (diagram == null) return false;
        DiagramPanel panel = diagram.Panel;
        if (panel == null) return false;
        // Get all of the points in screen/view coordinates
        Point first = panel.TransformModelToView(diagram.FirstMousePointInModel);
        Point last = panel.TransformModelToView(diagram.LastMousePointInModel);
        return (Math.Abs(last.X - first.X) > SystemParameters.MinimumHorizontalDragDistance ||
                Math.Abs(last.Y - first.Y) > SystemParameters.MinimumVerticalDragDistance);
    }

But instead of dragging the Panning-Cursor was shown.

I assume that is because the PanningTool is actually running? That’s odd, though, because that can only happen if the mouse-down is not over a Node or a Link (unless you customized that).

You could try overriding PanningTool.IsBeyondDragSize in the same manner. FYI, the DragSelectingTool is another tool whose CanStart method depends on IsBeyondDragSize.

You can reproduce this, if you modify your FlowGrammer-Demo CustomDraggingTool.
Override CanStart and IsBeyondDragSize and you see the same Effekt.

You don’t need to reproduce it.
I created a PanningTool and override the IsBeyondDragSize the same way as in the DraggingTool and now it is working.

Thank you.