Blockly は 2025 年 11 月 10 日に Raspberry Pi Foundation に移行しました。ブログ投稿とよくある質問をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >ConnectionDB >searchForClosest
ConnectionDB.searchForClosest() メソッド
この接続に最も近い互換性のある接続を見つけます。
署名:
searchForClosest(conn: RenderedConnection, maxRadius: number, dxy: Coordinate): {
connection: RenderedConnection | null;
radius: number;
};
パラメータ
| パラメータ |
型 |
説明 |
| 接続 |
RenderedConnection |
対応するパートナーを探している接続。 |
| maxRadius |
数値 |
別の接続までの最大半径。 |
| dxy |
座標 |
データベース内のこの接続の位置と現在の位置(ドラッグの結果)とのオフセット。 |
戻り値:
{ connection: RenderedConnection |null;radius: number;}
「connection」という 2 つのプロパティを含む別の接続または null、および「radius」距離です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],["The `searchForClosest()` method in `ConnectionDB` locates the nearest compatible connection. It takes a `RenderedConnection` (`conn`), a `maxRadius` (number), and a `Coordinate` (`dxy`) for location offset as parameters. It returns an object containing two properties: `connection`, which is either a found `RenderedConnection` or `null`, and `radius`, the distance to the found connection. The method identifies the closest matching connection within the defined radius.\n"]]