From cea66bd846e886776bcb9d376f0aa7c88cf73504 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
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/OverlayView.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/client/views/OverlayView.tsx')

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<HTMLDivElement>();
             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 (
                 <div
@@ -207,7 +207,7 @@ export class OverlayView extends React.Component {
                     ref={dref}
                     key={d[Id]}
                     onPointerDown={onPointerDown}
-                    style={{ top: d.type === 'presentation' ? 0 : undefined, width: NumCast(d._width), height: NumCast(d._height), transform: `translate(${d.x}px, ${d.y}px)` }}>
+                    style={{ top: d.type === 'presentation' ? 0 : undefined, width: NumCast(d._width), height: NumCast(d._height), transform: `translate(${d.overlayX}px, ${d.overlayY}px)` }}>
                     <DocumentView
                         Document={d}
                         rootSelected={returnTrue}
-- 
cgit v1.2.3-70-g09d2

