mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Bounds refactor and duplication removal
This commit is contained in:
parent
7b4e989d65
commit
91b6057d9c
28 changed files with 431 additions and 147 deletions
|
@ -102,6 +102,22 @@ export function pointRotateRads<Point extends GenericPoint>(
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate multiple points around a common center via the same angle in radians
|
||||
*
|
||||
* @param p The point array to rotate
|
||||
* @param c The common center point
|
||||
* @param angle The common angle to rotate by
|
||||
* @returns The array of rotated points
|
||||
*/
|
||||
function pointsRotateRads<Point extends GenericPoint>(
|
||||
p: Point[],
|
||||
c: Point,
|
||||
angle: Radians,
|
||||
): Point[] {
|
||||
return p.map((x, idx) => pointRotateRads(x, c, angle));
|
||||
}
|
||||
|
||||
/**
|
||||
* Roate a point by [angle] degree.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue