From 70217483bbf78c33981fdd60c5d49bba59a64ef5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 24 Feb 2024 15:47:31 +0100 Subject: [PATCH] feat: add delay option --- src/rough-notation.ts | 2 +- src/types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rough-notation.ts b/src/rough-notation.ts index 3d5dea2..dda8848 100644 --- a/src/rough-notation.ts +++ b/src/rough-notation.ts @@ -229,7 +229,7 @@ class RoughAnnotationImpl implements RoughAnnotation { const rect = rects[i] const ad = totalDuration * (rect.w / totalWidth) promises.push( - renderAnnotation(svg, rects[i], config, delay + this._animationDelay, ad, this._seed), + renderAnnotation(svg, rects[i], config, delay + this._animationDelay + (this._config.delay || 0), ad, this._seed), ) delay += ad } diff --git a/src/types.ts b/src/types.ts index 1c72698..a19846c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -26,6 +26,7 @@ export interface RoughAnnotationConfigBase extends Partial { padding?: RoughPadding // defaults to 5px iterations?: number // defaults to 2 brackets?: BracketType | BracketType[] // defaults to 'right' + delay?: number // defaults to 0 /** * Additional class to add to the root SVG element */