Skip to content

Commit

Permalink
account for monitor position when repositioning camera window
Browse files Browse the repository at this point in the history
closes #168
  • Loading branch information
Brendonovich committed Nov 14, 2024
1 parent ae8cd7c commit 9f53701
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/desktop/src/routes/camera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ export default function () {

const currentWindow = getCurrentWindow();
currentWindow.setSize(new LogicalSize(windowSize, windowHeight));
currentWindow.setPosition(new LogicalPosition(width, height));
currentWindow.setPosition(
new LogicalPosition(
width + monitor.position.toLogical(scalingFactor).x,
height + monitor.position.toLogical(scalingFactor).y
)
);

return { width, height, size: windowSize };
}
Expand Down Expand Up @@ -192,7 +197,7 @@ export default function () {
const aspectRatio =
latestFrame().width / latestFrame().height;

const windowWidth = windowSize()?.size ?? 0;
const windowWidth = windowSize.latest?.size ?? 0;

const size = (() => {
if (aspectRatio > 1)
Expand Down

1 comment on commit 9f53701

@vercel
Copy link

@vercel vercel bot commented on 9f53701 Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.