aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-01-03 23:44:28 -0500
committerbobzel <zzzman@gmail.com>2024-01-03 23:44:28 -0500
commit2ea594a4c1ff221200e0795fb07d30b603177a67 (patch)
treeb1f8869320a460b88e7a832f6679b9fdb84e6e28 /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
parent3f7b73ee8a3f75cd688ee7ddc7b54d90b00bee67 (diff)
cleaned up screenToLocalTransform in several places by making it additional methods. cleaned up styleProider api a bit to take DocumentViewInternalProps, not DocumentViewProps..
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx10
1 files changed, 4 insertions, 6 deletions
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;