mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-07 17:47:17 +02:00
account for rotation when moving the crop region
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
Reference in New Issue
Block a user