Skip to content

Commit

Permalink
fix: trace
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepbox8646 committed Dec 3, 2024
1 parent a81b720 commit d960646
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/lib/src/widgets/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ import {
type Rotatable,
type RotatableIns,
type Scalable,
Strokable,
type StrokableIns,
destory,
grow,
moveOnFunction,
moveOnPath,
trace,
traceFill,
} from "../animations";
import {
fadeIn,
Expand Down Expand Up @@ -350,6 +353,20 @@ export function widget(options: WidgetOptions) {
by: params?.by ?? ((x) => x),
});
});
registerAnimation<Strokable>("trace", (params?: AnimationParams) => {
return (manager) =>
manager.animate(trace, {
duration: params?.duration ?? defaultDuration,
by: params?.by ?? ((x) => x),
});
});
registerAnimation<Strokable>("traceFill", (params?: AnimationParams) => {
return (manager) =>
manager.animate(traceFill, {
duration: params?.duration ?? defaultDuration,
by: params?.by ?? ((x) => x),
});
});
registerAnimation<Widget>(
"animate",
<A>(
Expand Down

0 comments on commit d960646

Please sign in to comment.