SDA-3534 Snipping tool height shouldn't be greater than screen width and height (#1324)

This commit is contained in:
Salah Benmoussati 2022-01-18 13:23:09 +01:00 committed by GitHub
parent b34a6b3f90
commit cc2113eed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1169,9 +1169,9 @@ export class WindowHandler {
const display = screen.getDisplayMatching(this.mainWindow.getBounds());
const workAreaSize = display.workAreaSize;
const maxToolHeight = Math.floor(
calculatePercentage(workAreaSize.height, 90),
);
// Snipping tool height shouldn't be greater than min of screen width and height (screen orientation can be portrait or landscape)
const minSize = Math.min(workAreaSize.width, workAreaSize.height);
const maxToolHeight = Math.floor(calculatePercentage(minSize, 90));
const maxToolWidth = Math.floor(
calculatePercentage(workAreaSize.width, 90),
);
@ -1301,7 +1301,6 @@ export class WindowHandler {
);
}
});
this.snippingToolWindow.once('closed', () => {
logger.info(
'window-handler, createSnippingToolWindow: Closing snipping window, attempting to delete temp snip image',