From 1534c118ac45a29782ed374ca7914bbac8292385 Mon Sep 17 00:00:00 2001 From: bbb651 Date: Sun, 2 Feb 2025 18:49:26 +0200 Subject: [PATCH] Avoid using duration of 0 for non-animated cursors This fixes a crash with `wayland-cursor` and `anvil`, see: https://github.com/Smithay/smithay/pull/1653 I'm not sure which behavior is "correct", this seems to be undocumented but this reduces possible crashes. --- action/build/dist/main.js | 2 +- src/lib/animator/svg.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action/build/dist/main.js b/action/build/dist/main.js index 13595b8..74199c2 100644 --- a/action/build/dist/main.js +++ b/action/build/dist/main.js @@ -32404,7 +32404,7 @@ class SvgAnimator { } getAnimationFrames() { if (this.animatedElements.length === 0) { - return [{ svg: this.element, duration: 0 }]; + return [{ svg: this.element, duration: 1 }]; } const frames = []; const animationDuration = this.timeline.getEndTime(); diff --git a/src/lib/animator/svg.ts b/src/lib/animator/svg.ts index d662878..792354f 100644 --- a/src/lib/animator/svg.ts +++ b/src/lib/animator/svg.ts @@ -168,7 +168,7 @@ export class SvgAnimator { getAnimationFrames(): Frame[] { if (this.animatedElements.length === 0) { - return [{ svg: this.element, duration: 0 }]; + return [{ svg: this.element, duration: 1 }]; } const frames: Frame[] = []; const animationDuration = this.timeline.getEndTime();