使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly >RenderedConnection >最近
RenderedConnection.closest() 方法
查找与此连接距离最近的兼容连接。所有参数均采用工作区单元。
Signature:
closest(maxLimit: number, dxy: Coordinate): {
connection: RenderedConnection | null;
radius: number;
};
参数
参数 |
类型 |
说明 |
maxLimit |
number |
到另一连接的最大半径。 |
dxy |
坐标 |
此连接在数据库中的位置与当前位置(因拖动产生的)之间的偏移量。 |
返回:
{ connection: RenderedConnection |null;radius:number;}
包含两个属性:“连接”该参数为另一个连接或 null。即距离。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["The `closest()` method in `RenderedConnection` finds the nearest compatible connection within a specified radius (`maxLimit`). It considers an offset (`dxy`) representing a connection's movement. The method returns an object with two properties: `connection`, which is the closest `RenderedConnection` or `null` if none found, and `radius`, the distance to that connection. All calculations use workspace units.\n"]]