From cc75a03d89a4b553a53b55404464cd2ca93d9b48 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 22 Nov 2023 11:52:57 -0500 Subject: fixed more issues with rotation. restrutured how MarqueeAnnotator works to be simpler and more correct. --- src/client/views/nodes/VideoBox.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/client/views/nodes/VideoBox.tsx') diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 6ebf84738..8bf2f4ce5 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -64,6 +64,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent(); private _mainCont: React.RefObject = React.createRef(); // outermost div private _annotationLayer: React.RefObject = React.createRef(); private _playRegionTimer: any = null; // timeout for playback @@ -71,7 +72,6 @@ export class VideoBox extends ViewBoxAnnotatableComponent(); @observable _screenCapture = false; @observable _clicking = false; // used for transition between showing/hiding timeline @@ -867,7 +867,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent { MarqueeAnnotator.clearAnnotations(this._savedAnnotations); - this._marqueeing = [e.clientX, e.clientY]; + this._marqueeref.current?.onInitiateSelection([e.clientX, e.clientY]); return true; }), returnFalse, @@ -881,7 +881,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent { - this._marqueeing = undefined; + this._marqueeref.current?.onTerminateSelection(); this.props.select(true); }; @@ -912,7 +912,6 @@ export class VideoBox extends ViewBoxAnnotatableComponent ((this.props.NativeDimScaling?.() || 1) * this.heightPercent) / 100; marqueeOffset = () => [((this.panelWidth() / 2) * (1 - this.heightPercent / 100)) / (this.heightPercent / 100), 0]; timelineDocFilter = () => [`_isTimelineLabel:true,${Utils.noRecursionHack}:x`]; @@ -937,8 +936,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent StrListCast(this.dataDoc[this.fieldKey + '_thumbnails']); // renders CollectionStackedTimeline @computed get renderTimeline() { return ( @@ -963,7 +962,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent StrListCast(this.dataDoc[this.fieldKey + '_thumbnails'])} + thumbnails={this.thumbnails} renderDepth={this.props.renderDepth + 1} startTag={'_timecodeToShow' /* videoStart */} endTag={'_timecodeToHide' /* videoEnd */} @@ -1095,13 +1094,15 @@ export class VideoBox extends ViewBoxAnnotatableComponent {this.annotationLayer} - {!this._marqueeing || !this._mainCont.current || !this._annotationLayer.current ? null : ( + {!this._mainCont.current || !this._annotationLayer.current ? null : (