Stay organized with collections Save and categorize content based on your preferences.

blockly > ConnectionDB > searchForClosest

ConnectionDB.searchForClosest() method

Find the closest compatible connection to this connection.

Signature:

searchForClosest(conn: RenderedConnection, maxRadius: number, dxy: Coordinate): {
        connection: RenderedConnection | null;
        radius: number;
    };

Parameters

Parameter Type Description
conn RenderedConnection The connection searching for a compatible mate.
maxRadius number The maximum radius to another connection.
dxy Coordinate Offset between this connection's location in the database and the current location (as a result of dragging).

Returns:

{ connection: RenderedConnection | null; radius: number; }

Contains two properties: 'connection' which is either another connection or null, and 'radius' which is the distance.