blockly > RenderedConnection > 最も近いもの

RenderedConnection.closest() メソッド

この接続に最も近い互換性のある接続を探します。すべてのパラメータはワークスペース ユニットです。

署名:

closest(maxLimit: number, dxy: Coordinate): {
        connection: RenderedConnection | null;
        radius: number;
    };

パラメータ

パラメータ 種類 説明
maxLimit 数値 別の接続への最大半径。
DXY 座標 データベース内のこの接続の場所と現在の場所(ドラッグ結果として)の間のオフセット。

戻り値:

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

次の 2 つのプロパティがあります。「connection」は別の接続または null 、「radius」は距離です。