aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-23 21:52:48 -0400
committerbobzel <zzzman@gmail.com>2021-09-23 21:52:48 -0400
commit676cc1ef15653590eecf7f588fe02dd7d75863cc (patch)
tree0a379d47fffba0b48d4ba9c668b7aeb97bde6d29 /src/client/views/collections
parent802840c0e23bf4fcdcdf9ec262c45b09525be813 (diff)
fixed trimming already trimmed clips.
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionStackedTimeline.tsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx
index 0985e5b2e..12d70c05d 100644
--- a/src/client/views/collections/CollectionStackedTimeline.tsx
+++ b/src/client/views/collections/CollectionStackedTimeline.tsx
@@ -63,6 +63,8 @@ export type CollectionStackedTimelineProps = {
dictationKey: string;
rawDuration: number;
trimming: boolean;
+ clipStart: number;
+ clipEnd: number;
trimStart: () => number;
trimEnd: () => number;
trimDuration: number;
@@ -332,7 +334,7 @@ export class CollectionStackedTimeline extends CollectionSubView<
this.props.setEndTrim(Math.max(
Math.min(
this.trimEnd + (e.movementX / rect.width) * this.duration,
- this.duration
+ this.props.clipStart + this.duration
),
this.trimStart + this.minLength
));
@@ -582,7 +584,7 @@ export class CollectionStackedTimeline extends CollectionSubView<
start + (10 / timelineContentWidth) * this.duration
);
const left = this.props.trimming ?
- (start / this.duration) * timelineContentWidth
+ ((start - this.props.clipStart) / this.duration) * timelineContentWidth
: Math.max((start - this.trimStart) / this.props.trimDuration * timelineContentWidth, 0);
const top = (d.level / maxLevel) * this.timelineContentHeight() + 15;
const timespan = end - start;
@@ -631,7 +633,7 @@ export class CollectionStackedTimeline extends CollectionSubView<
className="collectionStackedTimeline-current"
style={{
left: this.props.trimming
- ? `${(this.currentTime / this.duration) * 100}%`
+ ? `${((this.currentTime - this.props.clipStart) / this.duration) * 100}%`
: `${(this.currentTime - this.trimStart) / (this.trimEnd - this.trimStart) * 100}%`,
}}
/>
@@ -640,13 +642,13 @@ export class CollectionStackedTimeline extends CollectionSubView<
<>
<div
className="collectionStackedTimeline-trim-shade"
- style={{ width: `${(this.trimStart / this.duration) * 100}%` }}
+ style={{ width: `${((this.trimStart - this.props.clipStart) / this.duration) * 100}%` }}
></div>
<div
className="collectionStackedTimeline-trim-controls"
style={{
- left: `${(this.trimStart / this.duration) * 100}%`,
+ left: `${((this.trimStart - this.props.clipStart) / this.duration) * 100}%`,
width: `${((this.trimEnd - this.trimStart) / this.duration) * 100
}%`,
}}
@@ -664,7 +666,7 @@ export class CollectionStackedTimeline extends CollectionSubView<
<div
className="collectionStackedTimeline-trim-shade"
style={{
- left: `${(this.trimEnd / this.duration) * 100}%`,
+ left: `${((this.trimEnd - this.props.clipStart) / this.duration) * 100}%`,
width: `${((this.duration - this.trimEnd) / this.duration) * 100
}%`,
}}