From 15614ffdc931b8e0b85448387c2bcca3b13bf3e2 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 26 Sep 2022 10:31:54 -0400
Subject: Update PresBox.tsx

fixed pinwithview videos so end time is clip's end time.
---
 src/client/views/nodes/trails/PresBox.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(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 3d9c38186..1a4ffa24f 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -421,7 +421,11 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
                 pinDoc.presPinViewScroll = pinDoc._scrollTop;
             }
             if (clippable) pinDoc.presPinClipWidth = pinDoc._clipWidth;
-            if (temporal) pinDoc.presEndTime = NumCast((pinDoc.presStartTime = pinDoc._currentTimecode)) + 0.1;
+            if (temporal) {
+                pinDoc.presStartTime = pinDoc._currentTimecode;
+                const duration = NumCast(pinDoc[`${Doc.LayoutFieldKey(pinDoc)}-duration`], NumCast(pinDoc.presStartTime) + 0.1);
+                pinDoc.presEndTime = NumCast(pinDoc.clipEnd, duration);
+            }
             if (textview) pinDoc.presData = targetDoc.text instanceof ObjectField ? targetDoc.text[Copy]() : targetDoc.text;
             if (dataview) pinDoc.presData = targetDoc.data instanceof ObjectField ? targetDoc.data[Copy]() : targetDoc.data;
             if (pannable || scrollable) {
-- 
cgit v1.2.3-70-g09d2

