Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Remove outerPosition and inside check

Richie McIlroy0be963d7c85c
diff --git a/apps/desktop/src/routes/target-select-overlay.tsx b/apps/desktop/src/routes/target-select-overlay.tsx
index e940c7235..621772ab2 100644
--- a/apps/desktop/src/routes/target-select-overlay.tsx
+++ b/apps/desktop/src/routes/target-select-overlay.tsx
@@ -89,8 +89,7 @@ async function repositionCameraForWindow(
const win = await WebviewWindow.getByLabel("camera");
if (!win) return;
- const [physPos, physSize, scaleFactor] = await Promise.all([
- win.outerPosition(),
+ const [physSize, scaleFactor] = await Promise.all([
win.outerSize(),
win.scaleFactor(),
]);
@@ -99,20 +98,11 @@ async function repositionCameraForWindow(
const displayOriginX = displayInfo.logical_bounds?.position?.x ?? 0;
const displayOriginY = displayInfo.logical_bounds?.position?.y ?? 0;
- const camPos = physPos.toLogical(scaleFactor);
const camSize = physSize.toLogical(scaleFactor);
const winAbsX = windowBounds.x + displayOriginX;
const winAbsY = windowBounds.y + displayOriginY;
- const cameraFullyInside =
- camPos.x >= winAbsX &&
- camPos.y >= winAbsY &&
- camPos.x + camSize.width <= winAbsX + windowBounds.width &&
- camPos.y + camSize.height <= winAbsY + windowBounds.height;
-
- if (cameraFullyInside) return;
-
const padding = 16;
if (
camSize.width + padding * 2 > windowBounds.width ||