diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-06-16 15:44:37 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-06-16 15:44:37 +0200 |
commit | 64aba383d6fbfa46fa558616c8bce868923d98a3 (patch) | |
tree | dc1acce3feedcd0d0cb4f93a490877142da25470 /pages | |
parent | b034f288d39e6fc58472db8711e5ba7b18ebc66b (diff) |
added placed class to #selection
Diffstat (limited to 'pages')
-rw-r--r-- | pages/editor.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx index 972c5f4..abb7b5e 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -351,6 +351,7 @@ function TimelineEditor(props: { }, []); var [selectionActive, setSelectionActive] = useState(false); + var [selectionPlaced, setSelectionPlaced] = useState(false); var [selectionHidden, setSelectionHidden] = useState(true); var [selectionLeftType, setSelectionLeftType] = useState(null); var [selectionRightType, setSelectionRightType] = useState(null); @@ -375,6 +376,7 @@ function TimelineEditor(props: { if (selectionHidden && distanceTraveled > minDistance) setSelectionHidden(false); if (selectionLeftType) setSelectionLeftType(null); if (selectionRightType) setSelectionRightType(null); + if (selectionPlaced) setSelectionPlaced(false); selectionPosAPI.start({ center: 0, startOffset: 0, @@ -432,6 +434,7 @@ function TimelineEditor(props: { }); setSelectionLeftType(left.type); setSelectionRightType(right.type); + setSelectionPlaced(true); } } }, { domTarget: selectionRef, eventOptions: { passive: false } }); @@ -484,7 +487,7 @@ function TimelineEditor(props: { {workingTimeline.map((slide: anySlide) => <TimelineKeyframe slide={slide} />)} <div id='selection' - className='posabs dispinbl' + className={'posabs dispinbl ' + (selectionPlaced ? 'placed ' : '')} style={{ left: `calc(var(--zoom) * ${selectionPos.startingFrame.toJSON() + selectionPos.center.toJSON()} * 1px - 6px + ${selectionPos.startOffset.toJSON()} * 1px)`, |