* 判断点是否在矩形内/边上也算 * 为什么边上也算,因为节点的位置在左上角上,可以用于判断节点是否存在于某位置
(point: Vector)
| 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 | * |
no outgoing calls
no test coverage detected