MCPcopy
hub / github.com/graphif/project-graph / isPointIn

Method isPointIn

packages/shapes/src/Rectangle.ts:324–328  ·  view source on GitHub ↗

* 判断点是否在矩形内/边上也算 * 为什么边上也算,因为节点的位置在左上角上,可以用于判断节点是否存在于某位置

(point: Vector)

Source from the content-addressed store, hash-verified

322 * 为什么边上也算,因为节点的位置在左上角上,可以用于判断节点是否存在于某位置
323 */
324 public isPointIn(point: Vector): boolean {
325 const collision_x = this.left <= point.x && point.x <= this.right;
326 const collision_y = this.top <= point.y && point.y <= this.bottom;
327 return collision_x && collision_y;
328 }
329
330 /**
331 *

Callers 2

isCollideWithLineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected