fix: crash on invalid zoomFactor (#22673)

This commit is contained in:
Shelley Vohr 2020-03-13 23:13:05 +00:00 committed by GitHub
parent 9c5874306d
commit a4c4c86b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 5 deletions

View file

@ -1060,11 +1060,13 @@ Returns `Boolean` - Whether audio is currently playing.
#### `contents.setZoomFactor(factor)`
* `factor` Number - Zoom factor.
* `factor` Double - Zoom factor; default is 1.0.
Changes the zoom factor to the specified factor. Zoom factor is
zoom percent divided by 100, so 300% = 3.0.
The factor must be greater than 0.0.
#### `contents.getZoomFactor()`
Returns `Number` - the current zoom factor.

View file

@ -22,11 +22,13 @@ The `WebFrame` class has the following instance methods:
### `webFrame.setZoomFactor(factor)`
* `factor` Number - Zoom factor.
* `factor` Double - Zoom factor; default is 1.0.
Changes the zoom factor to the specified factor. Zoom factor is
zoom percent divided by 100, so 300% = 3.0.
The factor must be greater than 0.0.
### `webFrame.getZoomFactor()`
Returns `Number` - The current zoom factor.