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:
axolotl
2026-01-31 07:18:56 +11:00
committed by GitHub
parent 331d1e16f5
commit f272723a33
4 changed files with 155 additions and 4 deletions

View File

@@ -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()`