From 6d52d5d485f06751ae55962c7ae0c578857f1cbe Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Mon, 2 Aug 2021 14:43:08 +0200 Subject: [PATCH] UX improvements * SequenceLengthIndicator has a cleaner look * It displays the time in the basic format now --- theatre/core/src/sequences/Sequence.ts | 5 ++ .../KeyframeEditor/Dot.tsx | 1 - .../DopeSheet/Right/LengthIndicator.tsx | 84 +++++++++++++------ 3 files changed, 65 insertions(+), 25 deletions(-) diff --git a/theatre/core/src/sequences/Sequence.ts b/theatre/core/src/sequences/Sequence.ts index 8ec819f..686425f 100644 --- a/theatre/core/src/sequences/Sequence.ts +++ b/theatre/core/src/sequences/Sequence.ts @@ -293,6 +293,7 @@ export interface ISequencePositionFormatter { formatSubUnitForGrid(posInUnitSpace: number): string formatFullUnitForGrid(posInUnitSpace: number): string formatForPlayhead(posInUnitSpace: number): string + formatBasic(posInUnitSpace: number): string } class TimeBasedPositionFormatter implements ISequencePositionFormatter { @@ -382,6 +383,10 @@ class TimeBasedPositionFormatter implements ISequencePositionFormatter { return s.length === 0 ? '00s00f' : s } + + formatBasic(posInUnitSpace: number): string { + return posInUnitSpace.toFixed(2) + 's' + } } const second = 1 diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx index 3683356..c2261e3 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/Dot.tsx @@ -66,7 +66,6 @@ const Dot: React.FC = (props) => { <> svg:first-child { + margin-right: -1px; + } + } + + & > svg:first-child { + margin-right: -4px; } ` @@ -121,34 +160,31 @@ const LengthIndicator: React.FC = ({layoutP}) => { <> {popoverNode} - { - openPopover(e, node!) - }} - {...{[attributeNameThatLocksFramestamp]: 'hide'}} - > - {sequence.positionFormatter.formatForPlayhead(sequenceLength)} - + + { + openPopover(e, node!) + }} + {...{[attributeNameThatLocksFramestamp]: 'hide'}} + > + + + + + {sequence.positionFormatter.formatBasic(sequenceLength)} + + { - // getStudio()!.transaction(({stateEditors}) => { - // stateEditors.coreByProject.historic.sheetsById.sequence.setLength({ - // ...sheet.address, - // length: 10, - // }) - // }) - // }} style={{ height: height + 'px', transform: `translateX(${translateX}px) scale(${scaleX}, 1)`,