Skip to content

ElectronBrowserWindow.setAspectRatio method

ElectronBrowserWindow › setAspectRatio

Unofficial

Makes the window maintain an aspect ratio.

Signature:

setAspectRatio(aspectRatio: number, extraSize?: ElectronSize): void

Parameters:

ParameterTypeDescription
aspectRationumberThe aspect ratio to maintain.
extraSize?ElectronSizeExtra size not included within the aspect ratio calculations.

Returns: void