From f66eaad00dbfe27e8dbe28019d1148a70f6ba0d9 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 3 Feb 2025 12:44:38 -0500 Subject: fixed defaults for roll animations effect. fixed hideBefore pres effect to not show Doc before effect starts --- src/client/views/nodes/FocusViewOptions.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/client/views/nodes/FocusViewOptions.ts') diff --git a/src/client/views/nodes/FocusViewOptions.ts b/src/client/views/nodes/FocusViewOptions.ts index bb0d2b03c..1c462e98f 100644 --- a/src/client/views/nodes/FocusViewOptions.ts +++ b/src/client/views/nodes/FocusViewOptions.ts @@ -22,3 +22,14 @@ export interface FocusViewOptions { pointFocus?: { X: number; Y: number }; // clientX and clientY coordinates to focus on instead of a document target (used by explore mode) contextPath?: Doc[]; // path of inner documents that will also be focused } + +/** + * if there's an options.effect, it will be handled from linkFollowHighlight. We delay the start of + * the highlight so that the target document can be somewhat centered so that the effect/highlight will be seen + * bcz: should this delay be an options parameter? + * @param options + * @returns + */ +export function FocusEffectDelay(options: FocusViewOptions) { + return (options.zoomTime ?? 0) * 0.5; +} -- cgit v1.2.3-70-g09d2