aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2021-09-20 22:25:03 -0400
committermehekj <mehek.jethani@gmail.com>2021-09-20 22:25:03 -0400
commit64e265d9cba009469081fdf4ba3272c78a3a76a8 (patch)
treeb9fd90d9509f6f79dbba301833afc695c86472fe /src/client/views/collections
parentff4350bf1bf7e81d74ef1b369315ca56bcb9ff02 (diff)
partially added dragging timeline markers
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionStackedTimeline.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx
index 8608700aa..0ef6f852a 100644
--- a/src/client/views/collections/CollectionStackedTimeline.tsx
+++ b/src/client/views/collections/CollectionStackedTimeline.tsx
@@ -354,6 +354,13 @@ export class CollectionStackedTimeline extends CollectionSubView<
// determine x coordinate of drop and assign it to the documents being dragged --- see internalDocDrop of collectionFreeFormView.tsx for how it's done when dropping onto a 2D freeform view
+ const x = docDragData.offset[0];
+ const timelineContentWidth = this.props.PanelWidth();
+ for (let i = 0; i < docDragData.droppedDocuments.length; i++) {
+ const d = docDragData.droppedDocuments[i];
+ d._timecodeToShow = x / timelineContentWidth * this.props.trimDuration + NumCast(d._timecodeToShow);
+ d._timecodeToHide = x / timelineContentWidth * this.props.trimDuration + NumCast(d._timecodeToHide);
+ }
return true;
}
@@ -573,14 +580,14 @@ export class CollectionStackedTimeline extends CollectionSubView<
const left = this.props.trimming ?
(start / this.duration) * timelineContentWidth
: Math.max((start - this.trimStart) / this.props.trimDuration * timelineContentWidth, 0);
- const top = (d.level / maxLevel) * this.timelineContentHeight();
+ const top = (d.level / maxLevel) * this.timelineContentHeight() + 15;
const timespan = end - start;
let width = (timespan / this.props.trimDuration) * timelineContentWidth;
width = (!this.props.trimming && left == 0) ?
width - ((this.trimStart - start) / this.props.trimDuration * timelineContentWidth) : width;
width = (!this.props.trimming && this.trimEnd < end) ?
width - ((end - this.trimEnd) / this.props.trimDuration * timelineContentWidth) : width;
- const height = this.timelineContentHeight() / maxLevel
+ const height = (this.timelineContentHeight()) / maxLevel;
return this.props.Document.hideAnchors ? null : (
<div
className={"collectionStackedTimeline-marker-timeline"}