From e7a69c89363b3bdeae713f509d4283cf69ac7484 Mon Sep 17 00:00:00 2001
From: geireann <geireann.lindfield@gmail.com>
Date: Thu, 11 Jul 2024 14:25:56 -0400
Subject: fixed transforms for treeView.  cleanedup/commented some code.

---
 src/client/views/collections/TreeView.tsx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/client/views/collections/TreeView.tsx')

diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index b82421e6b..f69aea2a7 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -469,14 +469,12 @@ export class TreeView extends ObservableReactComponent<TreeViewProps> {
         return false;
     }
 
-    refTransform = (ref: HTMLDivElement | undefined | null) => {
+    refTransform = (ref: HTMLElement | undefined | null) => {
         if (!ref) return this.ScreenToLocalTransform();
-        const { translateX, translateY } = ClientUtils.GetScreenTransform(ref);
-        const outerXf = ClientUtils.GetScreenTransform(this.treeView.MainEle());
-        const offset = this.ScreenToLocalTransform().transformDirection(outerXf.translateX - translateX, outerXf.translateY - translateY);
-        return this.ScreenToLocalTransform().translate(offset[0], offset[1]);
+        const { translateX, translateY, scale } = ClientUtils.GetScreenTransform(ref);
+        return new Transform(-translateX, -translateY, 1).scale(1/scale);
     };
-    docTransform = () => this.refTransform(this._dref?.ContentRef?.current);
+    docTransform = () => this.refTransform(this._dref?.ContentDiv);
     getTransform = () => this.refTransform(this._tref.current);
     embeddedPanelWidth = () => this._props.panelWidth() / (this.treeView._props.NativeDimScaling?.() || 1);
     embeddedPanelHeight = () => {
-- 
cgit v1.2.3-70-g09d2

