From 4dcfd8efdd92b8c1b643e288d36ee531d2417ff5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 25 Jul 2021 12:46:45 +0200 Subject: rerender dummies --- pages/editor.tsx | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index c8de635..557fd10 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -19,7 +19,7 @@ import PlaySkipIconAni from '../components/play-skip'; import Selection from '../components/selection'; import TimecodeInput from '../components/timeinput'; import Project, { arrayBufferToBase64, PresentationSettings, VideoSources, VideoSourceType } from '../project'; -import timeline, { +import { anySlide, clickThroughBehaviours, loopBeginSlide, @@ -97,6 +97,11 @@ export interface globalState { update: { refreshLiveTimeline: () => void; }; + dummies: { + all: number; + timeline: number; + tools: number; + }; } var global = createState({ @@ -144,6 +149,11 @@ var global = createState({ project.timeline = player.timeline; }, }, + dummies: { + all: 0, + timeline: 0, + tools: 0, + }, }); var settings = { @@ -673,6 +683,9 @@ function getMarkerSpacing() { } function TimelineEditor() { + var dummy = useHookstate(global).dummies.timeline; + dummy.get(); + var timelineZoom = useHookstate(global).timeline.zoom; var workingTimeline = useHookstate(global).timeline.workingTimeline; var tool = useHookstate(global).timeline.tool; @@ -1069,7 +1082,11 @@ function DefaultSettings() { {(() => { if (!project.video) return null; var SourceSettings = VideoSources.find(s => s.type == project.video.type).settings; - return ; + return ; })()}
@@ -1269,6 +1286,9 @@ function zoomAroundPoint(newZoom: number, pivot: number) { var switchToTool = (tool: string) => () => global.ready.timeline.value && global.timeline.tool.set(tool); function Tools() { + var dummy = useHookstate(global).dummies.tools; + dummy.get(); + var frame = useHookstate(global).timeline.frame; var tool = useHookstate(global).timeline.tool; var timelineZoom = useHookstate(global).timeline.zoom; @@ -1441,6 +1461,9 @@ function TitleBar() { } export default function Index() { + var dummy = useHookstate(global).dummies.all; + dummy.get(); + useEffect(() => { var preventDefault = (e: Event) => e.preventDefault(); document.addEventListener('gesturestart', preventDefault); -- cgit v1.2.3