Support negative zoom (#2412)

This commit is contained in:
Felix Häusler 2020-11-30 09:08:48 +01:00 committed by GitHub
parent 63642d3921
commit c24ef6ea4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 9 deletions

View File

@ -17,5 +17,5 @@ export const zoomOut = win => {
const { webContents } = win
const zoom = webContents.getZoomFactor()
// WORKAROUND: We need to set zoom on the browser window due to Electron#16018.
webContents.send('mt::window-zoom', Math.max(1.0, zoom - 0.125))
webContents.send('mt::window-zoom', Math.max(0.5, zoom - 0.125))
}

View File

@ -531,38 +531,50 @@ const commands = [
description: 'Window: Zoom...',
subcommands: [{
id: 'file.zoom-0',
description: '0.625',
value: 0.625
}, {
id: 'file.zoom-1',
description: '0.75',
value: 0.75
}, {
id: 'file.zoom-2',
description: '0.875',
value: 0.875
}, {
id: 'file.zoom-3',
description: '1.0',
value: 1.0
}, {
id: 'file.zoom-1',
id: 'file.zoom-4',
description: '1.125',
value: 1.125
}, {
id: 'file.zoom-2',
id: 'file.zoom-5',
description: '1.25',
value: 1.25
}, {
id: 'file.zoom-3',
id: 'file.zoom-6',
description: '1.375',
value: 1.375
}, {
id: 'file.zoom-4',
id: 'file.zoom-7',
description: '1.5',
value: 1.5
}, {
id: 'file.zoom-5',
id: 'file.zoom-8',
description: '1.625',
value: 1.625
}, {
id: 'file.zoom-6',
id: 'file.zoom-9',
description: '1.75',
value: 1.75
}, {
id: 'file.zoom-7',
id: 'file.zoom-10',
description: '1.875',
value: 1.875
}, {
id: 'file.zoom-8',
id: 'file.zoom-11',
description: '2.0',
value: 2.0
}],