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

@@ -133,5 +133,18 @@ describe('View', () => {
parent.setBounds({ x: 50, y: 60, width: 500, height: 600 });
expect(child.getBounds()).to.deep.equal({ x: 10, y: 15, width: 25, height: 30 });
});
it('can set bounds with animation', (done) => {
const v = new View();
v.setBounds({ x: 0, y: 0, width: 100, height: 100 }, {
animate: {
duration: 300
}
});
setTimeout(() => {
expect(v.getBounds()).to.deep.equal({ x: 0, y: 0, width: 100, height: 100 });
done();
}, 350);
});
});
});