feat: add delay option

This commit is contained in:
Anthony Fu
2024-02-24 15:47:31 +01:00
parent 57ec6a67c4
commit 70217483bb
2 changed files with 2 additions and 1 deletions

View File

@@ -229,7 +229,7 @@ class RoughAnnotationImpl implements RoughAnnotation {
const rect = rects[i] const rect = rects[i]
const ad = totalDuration * (rect.w / totalWidth) const ad = totalDuration * (rect.w / totalWidth)
promises.push( 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 delay += ad
} }

View File

@@ -26,6 +26,7 @@ export interface RoughAnnotationConfigBase extends Partial<ResolvedOptions> {
padding?: RoughPadding // defaults to 5px padding?: RoughPadding // defaults to 5px
iterations?: number // defaults to 2 iterations?: number // defaults to 2
brackets?: BracketType | BracketType[] // defaults to 'right' brackets?: BracketType | BracketType[] // defaults to 'right'
delay?: number // defaults to 0
/** /**
* Additional class to add to the root SVG element * Additional class to add to the root SVG element
*/ */