From d960646c58dc24217d2a28870e57ce3f5af41a83 Mon Sep 17 00:00:00 2001 From: Acbox liu <850625057@qq.com> Date: Tue, 3 Dec 2024 16:43:04 +0800 Subject: [PATCH] fix: trace --- packages/lib/src/widgets/widget.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/lib/src/widgets/widget.ts b/packages/lib/src/widgets/widget.ts index 4761fe9..3a880a1 100644 --- a/packages/lib/src/widgets/widget.ts +++ b/packages/lib/src/widgets/widget.ts @@ -17,11 +17,14 @@ import { type Rotatable, type RotatableIns, type Scalable, + Strokable, type StrokableIns, destory, grow, moveOnFunction, moveOnPath, + trace, + traceFill, } from "../animations"; import { fadeIn, @@ -350,6 +353,20 @@ export function widget(options: WidgetOptions) { by: params?.by ?? ((x) => x), }); }); + registerAnimation("trace", (params?: AnimationParams) => { + return (manager) => + manager.animate(trace, { + duration: params?.duration ?? defaultDuration, + by: params?.by ?? ((x) => x), + }); + }); + registerAnimation("traceFill", (params?: AnimationParams) => { + return (manager) => + manager.animate(traceFill, { + duration: params?.duration ?? defaultDuration, + by: params?.by ?? ((x) => x), + }); + }); registerAnimation( "animate", (