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

Method fromPoints

packages/shapes/src/Rectangle.ts:348–352  ·  view source on GitHub ↗
(p1: Vector, p2: Vector)

Source from the content-addressed store, hash-verified

346 }
347
348 static fromPoints(p1: Vector, p2: Vector): Rectangle {
349 const location = p1.clone();
350 const size = p2.clone().subtract(p1);
351 return new Rectangle(location, size);
352 }
353
354 /**
355 * 返回一个线段和这个矩形的交点,如果没有交点,就返回这个矩形的中心点

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.45
subtractMethod · 0.45

Tested by

no test coverage detected