mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
account for rotation when moving the crop region
This commit is contained in:
parent
80ff1562b8
commit
e30fd9960d
2 changed files with 87 additions and 7 deletions
|
@ -139,3 +139,10 @@ export const vectorNormalize = (v: Vector): Vector => {
|
|||
|
||||
return vector(v[0] / m, v[1] / m);
|
||||
};
|
||||
|
||||
/**
|
||||
* Project the first vector onto the second vector
|
||||
*/
|
||||
export const vectorProjection = (a: Vector, b: Vector) => {
|
||||
return vectorScale(b, vectorDot(a, b) / vectorDot(b, b));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue