Skip to content

Commit

Permalink
feat: improve screenshot plugin dimensions and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferenc Sárai committed Nov 28, 2024
1 parent 63fdc87 commit 123be2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/screenshot/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export function getScreenSize(resizeBy = 3) {
const scaleFactor = primaryDisplay.scaleFactor

const defaultScreenSize = {
width: (width / resizeBy) * scaleFactor,
height: (height / resizeBy) * scaleFactor,
width: Math.floor((width / resizeBy) * scaleFactor),
height: Math.floor((height / resizeBy) * scaleFactor),
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/screenshot/windows/preview/preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ iframe {
img {
display: block;
max-width: 90%;
max-height: 720px;
max-height: 75vh;
object-fit: contain;
}

Expand Down
1 change: 1 addition & 0 deletions src/plugins/screenshot/windows/preview/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function createPreviewWindow(imgDataURL: string) {
previewWindow = new BrowserWindow({
width: defaultScreenSize.width,
height: defaultScreenSize.height,
useContentSize: true,
resizable: false,
webPreferences: {
preload: path.join(__dirname, 'preview-preload.js'),
Expand Down

0 comments on commit 123be2d

Please sign in to comment.