fix: normalize behavior of win.setOpacity()
for invalid number values across operating systems (#19535)
* fix: define behavior for out-of-bounds setOpacity * fix linux issue * fix getOpacity behaviour * wrong variable * normalize more stuff * docs * test: use ifdescribe helper * Update spec-main/api-browser-window-spec.ts Co-Authored-By: Charles Kerr <ckerr@github.com> * fixes * more tests!!! * Update shell/browser/native_window_views.cc Co-Authored-By: Charles Kerr <ckerr@github.com> * Update shell/browser/native_window_mac.mm Co-Authored-By: Charles Kerr <ckerr@github.com>
This commit is contained in:
parent
761a4deab3
commit
8a9a5d69b6
4 changed files with 51 additions and 20 deletions
|
@ -1455,11 +1455,13 @@ On Windows and Linux always returns
|
|||
|
||||
* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque)
|
||||
|
||||
Sets the opacity of the window. On Linux does nothing.
|
||||
Sets the opacity of the window. On Linux, does nothing. Out of bound number
|
||||
values are clamped to the [0, 1] range.
|
||||
|
||||
#### `win.getOpacity()` _Windows_ _macOS_
|
||||
#### `win.getOpacity()`
|
||||
|
||||
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque)
|
||||
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On
|
||||
Linux, always returns 1.
|
||||
|
||||
#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue