From 2ea594a4c1ff221200e0795fb07d30b603177a67 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 3 Jan 2024 23:44:28 -0500
Subject: cleaned up screenToLocalTransform in several places by making it
 additional methods.  cleaned up styleProider api a bit to take
 DocumentViewInternalProps, not DocumentViewProps..

---
 .../collectionFreeForm/CollectionFreeFormLinkView.tsx          | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

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

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
index 6131fe037..5204633ea 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
@@ -22,8 +22,6 @@ export interface CollectionFreeFormLinkViewProps {
     LinkDocs: Doc[];
 }
 
-// props.screentolocatransform
-
 @observer
 export class CollectionFreeFormLinkView extends ObservableReactComponent<CollectionFreeFormLinkViewProps> {
     @observable _opacity: number = 0;
@@ -42,10 +40,10 @@ export class CollectionFreeFormLinkView extends ObservableReactComponent<Collect
     componentDidMount() {
         this._anchorDisposer = reaction(
             () => [
-                this._props.A._props.ScreenToLocalTransform(),
+                this._props.A.screenToViewTransform(),
                 Cast(Cast(Cast(this._props.A.Document, Doc, null)?.link_anchor_1, Doc, null)?.annotationOn, Doc, null)?.layout_scrollTop,
                 Cast(Cast(Cast(this._props.A.Document, Doc, null)?.link_anchor_1, Doc, null)?.annotationOn, Doc, null)?.[DocCss],
-                this._props.B._props.ScreenToLocalTransform(),
+                this._props.B.screenToViewTransform(),
                 Cast(Cast(Cast(this._props.A.Document, Doc, null)?.link_anchor_2, Doc, null)?.annotationOn, Doc, null)?.layout_scrollTop,
                 Cast(Cast(Cast(this._props.A.Document, Doc, null)?.link_anchor_2, Doc, null)?.annotationOn, Doc, null)?.[DocCss],
             ],
@@ -91,7 +89,7 @@ export class CollectionFreeFormLinkView extends ObservableReactComponent<Collect
             }
         } else {
             const m = targetAhyperlink.getBoundingClientRect();
-            const mp = A._props.ScreenToLocalTransform().transformPoint(m.right, m.top + 5);
+            const mp = A.screenToViewTransform().transformPoint(m.right, m.top + 5);
             const mpx = mp[0] / A._props.PanelWidth();
             const mpy = mp[1] / A._props.PanelHeight();
             if (mpx >= 0 && mpx <= 1) linkDoc.link_anchor_1_x = mpx * 100;
@@ -106,7 +104,7 @@ export class CollectionFreeFormLinkView extends ObservableReactComponent<Collect
             }
         } else {
             const m = targetBhyperlink.getBoundingClientRect();
-            const mp = B._props.ScreenToLocalTransform().transformPoint(m.right, m.top + 5);
+            const mp = B.screenToViewTransform().transformPoint(m.right, m.top + 5);
             const mpx = mp[0] / B._props.PanelWidth();
             const mpy = mp[1] / B._props.PanelHeight();
             if (mpx >= 0 && mpx <= 1) linkDoc.link_anchor_2_x = mpx * 100;
-- 
cgit v1.2.3-70-g09d2

