From 0d30ce10e54a894edb12b77330cc3c5edae83705 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 14 Jun 2021 11:20:01 +0200 Subject: selection doesn't break with new keyframes --- pages/editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/editor.tsx b/pages/editor.tsx index be8e0c6..36247a6 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -216,6 +216,7 @@ function TimelineEditor(props: { var workingTimeline = useWorkingTimeline((st: any) => st.timeline); var setWorkingTimeline = useWorkingTimeline((st: any) => st.setTimeline); + var refreshWorkingTimline = useWorkingTimeline((st: any) => st.refreshLiveTimeline); var setFrame = useFrame((st: any) => st.setFrame); @@ -406,7 +407,7 @@ function TimelineEditor(props: { if (distanceTraveled <= minDistance) setSelectionHidden(true); else { var endingFrame = startingFrame + frameWidth; - var keyframesInSelection = workingTimeline.filter((slide: anySlide) => + var keyframesInSelection = player.timeline.slides.filter((slide: anySlide) => slide.frame >= Math.floor(startingFrame) && slide.frame <= Math.ceil(endingFrame) ); @@ -451,6 +452,7 @@ function TimelineEditor(props: { x: frame, y: event.clientY - window.innerHeight + 210, }; + refreshWorkingTimline(); }} />
-- cgit v1.2.3