mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
feat: Allow View.setBounds to animate (#48812)
* feat: allow View::SetBounds to animate * fix: support width/height animations * fix: jumping on subsequent animations * fix: segfault race condition * fix: remove layer background * fix: layer clips not being reset * refactor: use gfx tween gin converter * fix: layer cleanups causing flickering views * chore: merge artifact * fix: missing private method in header * fix: return type * fix: do not set layer opacity * refactor: update animate parameter format * refactor: move animate into options object * chore: typo * docs: update * spec: add view animation test
This commit is contained in:
@@ -62,9 +62,17 @@ it becomes the topmost view.
|
||||
|
||||
If the view passed as a parameter is not a child of this view, this method is a no-op.
|
||||
|
||||
#### `view.setBounds(bounds)`
|
||||
#### `view.setBounds(bounds[, options])`
|
||||
|
||||
* `bounds` [Rectangle](structures/rectangle.md) - New bounds of the View.
|
||||
* `options` Object (optional) - Options for setting the bounds.
|
||||
* `animate` boolean | Object (optional) - If true, the bounds change will be animated. If an object is passed, it can contain the following properties:
|
||||
* `duration` Integer (optional) - Duration of the animation in milliseconds. Default is `250`.
|
||||
* `easing` string (optional) - Easing function for the animation. Default is `linear`.
|
||||
* `linear`
|
||||
* `ease-in`
|
||||
* `ease-out`
|
||||
* `ease-in-out`
|
||||
|
||||
#### `view.getBounds()`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user