From 97bc8fb32741051554509eeaf9d223b327ebd611 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 7 Feb 2024 00:02:36 -0500
Subject: switch to xAnchor to clean up link lines.   added transition to
 getBounds() so that LinkBox can follow animated transitions.  added
 dataTransitions for stacking view.  fixed presBox to be able to clear
 transition timers when a new slide transition is chosen.

---
 src/client/views/nodes/trails/PresBox.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/client/views/nodes/trails/PresBox.tsx')

diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 1b2c45e72..b8f6575dd 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -4,7 +4,7 @@ import { action, computed, IReactionDisposer, makeObservable, observable, Observ
 import { observer } from 'mobx-react';
 import * as React from 'react';
 import { Doc, DocListCast, Field, FieldResult, NumListCast, Opt, StrListCast } from '../../../../fields/Doc';
-import { Animation, DocData } from '../../../../fields/DocSymbols';
+import { Animation, DocData, TransitionTimer } from '../../../../fields/DocSymbols';
 import { Copy, Id } from '../../../../fields/FieldSymbols';
 import { InkField } from '../../../../fields/InkField';
 import { List } from '../../../../fields/List';
@@ -414,7 +414,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
                 bestTarget.rotation = NumCast(activeItem.config_rotation, NumCast(bestTarget.rotation));
                 bestTarget.width = NumCast(activeItem.config_width, NumCast(bestTarget.width));
                 bestTarget.height = NumCast(activeItem.config_height, NumCast(bestTarget.height));
-                setTimeout(() => (bestTarget._dataTransition = undefined), transTime + 10);
+                bestTarget[TransitionTimer] && clearTimeout(bestTarget[TransitionTimer]);
+                bestTarget[TransitionTimer] = setTimeout(() => (bestTarget[TransitionTimer] = bestTarget._dataTransition = undefined), transTime + 10);
                 changed = true;
             }
         }
@@ -441,7 +442,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
                 const bestTargetData = bestTarget[DocData];
                 const current = bestTargetData[fkey];
                 const hash = bestTargetData[fkey] ? stringHash(Field.toString(bestTargetData[fkey] as Field)) : undefined;
-                if (hash)  bestTargetData[fkey + '_' +hash] = current instanceof ObjectField ? current[Copy]() : current;
+                if (hash) bestTargetData[fkey + '_' + hash] = current instanceof ObjectField ? current[Copy]() : current;
                 bestTargetData[fkey] = activeItem.config_data instanceof ObjectField ? activeItem.config_data[Copy]() : activeItem.config_data;
             }
             bestTarget[fkey + '_usePath'] = activeItem.config_usePath;
-- 
cgit v1.2.3-70-g09d2

