blockly > ConnectionDB > searchForClosest

ConnectionDB.searchForClosest() 方法

查找与此连接最接近的兼容连接。

Signature:

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

参数

参数 类型 说明
conn RenderedConnection 正在寻找合适的伴侣的联系人。
maxRadius number 到另一个连接的最大半径。
dxy 坐标 此连接在数据库中的位置与当前位置之间的偏移量(因拖动而产生的)。

返回

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

包含两个属性:“connection”(另一个连接或 null)属性和“radius”(距离)是。