Merge pull request #1601 from lightpanda-io/animation-cancel
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
e2e-test / browser fetch (push) Has been cancelled
zig-test / zig test using v8 in debug mode (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled

implement Animation.cancel()
This commit is contained in:
Karl Seguin
2026-02-19 21:37:08 +08:00
committed by GitHub

View File

@@ -87,8 +87,11 @@ pub fn pause(self: *Animation) void {
self._playState = .paused; self._playState = .paused;
} }
pub fn cancel(_: *Animation) void { pub fn cancel(self: *Animation) void {
log.warn(.not_implemented, "Animation.cancel", .{}); // Transition to idle. If the animation was .running, the already-scheduled
// update() callback will fire but see .idle state, skip the finish
// transition, and release the strong ref via weakRef() as normal.
self._playState = .idle;
} }
pub fn finish(self: *Animation, page: *Page) void { pub fn finish(self: *Animation, page: *Page) void {