From cea66bd846e886776bcb9d376f0aa7c88cf73504 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 13 Sep 2022 21:43:59 -0400 Subject: made overlayX/overlayY instead of re-using x/y in order that overlay docs can be dragged in playground mode (for shared mini-player presentations) without necessarily allowing regular docs to be dragged in playground mode. --- src/client/views/MainView.tsx | 4 ++-- src/client/views/OverlayView.tsx | 12 ++++++------ src/client/views/nodes/trails/PresBox.tsx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 2aa7f392b..4bf6bb881 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -167,8 +167,8 @@ export class MainView extends React.Component { 'timelineHeightPercent', 'panX', 'panY', - 'x', - 'y', + 'overlayX', + 'overlayY', 'fitWidth', 'nativeWidth', 'nativeHeight', diff --git a/src/client/views/OverlayView.tsx b/src/client/views/OverlayView.tsx index 5242fabb8..2354e84ff 100644 --- a/src/client/views/OverlayView.tsx +++ b/src/client/views/OverlayView.tsx @@ -164,7 +164,7 @@ export class OverlayView extends React.Component { docScreenToLocalXf = computedFn( function docScreenToLocalXf(this: any, doc: Doc) { - return () => new Transform(-NumCast(doc.x), -NumCast(doc.y), 1); + return () => new Transform(-NumCast(doc.overlayX), -NumCast(doc.overlayY), 1); }.bind(this) ); @@ -175,8 +175,8 @@ export class OverlayView extends React.Component { const dref = React.createRef(); const onPointerMove = action((e: PointerEvent, down: number[]) => { if (e.buttons === 1) { - d.x = e.clientX + offsetx; - d.y = e.clientY + offsety; + d.overlayX = e.clientX + offsetx; + d.overlayY = e.clientY + offsety; } if (e.metaKey) { const dragData = new DragManager.DocumentDragData([d]); @@ -198,8 +198,8 @@ export class OverlayView extends React.Component { const onPointerDown = (e: React.PointerEvent) => { setupMoveUpEvents(this, e, onPointerMove, emptyFunction, emptyFunction); - offsetx = NumCast(d.x) - e.clientX; - offsety = NumCast(d.y) - e.clientY; + offsetx = NumCast(d.overlayX) - e.clientX; + offsety = NumCast(d.overlayY) - e.clientY; }; return (
+ style={{ top: d.type === 'presentation' ? 0 : undefined, width: NumCast(d._width), height: NumCast(d._height), transform: `translate(${d.overlayX}px, ${d.overlayY}px)` }}> () { this.layoutDoc.presStatus = PresStatus.Edit; clearTimeout(this._presTimer); const pt = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0); - this.rootDoc.x = pt[0] + (this.props.PanelWidth() - 250); - this.rootDoc.y = pt[1] + 10; + this.rootDoc.overlayX = pt[0] + (this.props.PanelWidth() - 250); + this.rootDoc.overlayY = pt[1] + 10; this.rootDoc._height = 30; this.rootDoc._width = 248; Doc.AddDocToList(Doc.MyOverlayDocs, undefined, this.rootDoc); -- cgit v1.2.3-70-g09d2