Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathid99c10c15ecd
diff --git a/web/apps/photos/src/services/face/geom.ts b/web/apps/photos/src/services/face/geom.ts
index b97f292e13..1ff5de5177 100644
--- a/web/apps/photos/src/services/face/geom.ts
+++ b/web/apps/photos/src/services/face/geom.ts
@@ -73,16 +73,15 @@ export class Box implements IRect {
}
}
-export function enlargeBox(box: Box, factor: number = 1.5) {
+export const enlargeBox = (box: Box, factor: number) => {
const center = new Point(box.x + box.width / 2, box.y + box.height / 2);
+ const newWidth = factor * box.width;
+ const newHeight = factor * box.height;
- const size = new Point(box.width, box.height);
- const newHalfSize = new Point((factor * size.x) / 2, (factor * size.y) / 2);
-
- return boxFromBoundingBox({
- left: center.x - newHalfSize.x,
- top: center.y - newHalfSize.y,
- right: center.x + newHalfSize.x,
- bottom: center.y + newHalfSize.y,
+ return new Box({
+ x: center.x - newWidth / 2,
+ y: center.y - newHeight / 2,
+ width: newWidth,
+ height: newHeight,
});
-}
+};