aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/MapboxMapBox/MapboxContainer.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/nodes/MapboxMapBox/MapboxContainer.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/nodes/MapboxMapBox/MapboxContainer.tsx')
-rw-r--r--src/client/views/nodes/MapboxMapBox/MapboxContainer.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/MapboxMapBox/MapboxContainer.tsx b/src/client/views/nodes/MapboxMapBox/MapboxContainer.tsx
index 2c31bbab7..8b22a1531 100644
--- a/src/client/views/nodes/MapboxMapBox/MapboxContainer.tsx
+++ b/src/client/views/nodes/MapboxMapBox/MapboxContainer.tsx
@@ -280,7 +280,7 @@ export class MapBoxContainer extends ViewBoxAnnotatableComponent<ViewBoxAnnotata
panelWidth = () => this._props.PanelWidth() / (this._props.NativeDimScaling?.() || 1) - this.sidebarWidth();
panelHeight = () => this._props.PanelHeight() / (this._props.NativeDimScaling?.() || 1);
- scrollXf = () => this._props.ScreenToLocalTransform().translate(0, NumCast(this.layoutDoc._layout_scrollTop));
+ scrollXf = () => this.ScreenToLocalBoxXf().translate(0, NumCast(this.layoutDoc._layout_scrollTop));
transparentFilter = () => [...this._props.childFilters(), Utils.TransparentBackgroundFilter];
opaqueFilter = () => [...this._props.childFilters(), Utils.OpaqueBackgroundFilter];
infoWidth = () => this._props.PanelWidth() / 5;
@@ -401,7 +401,7 @@ export class MapBoxContainer extends ViewBoxAnnotatableComponent<ViewBoxAnnotata
const point = this._bingMap.current.tryLocationToPixel(new this.MicrosoftMaps.Location(this.selectedPin.latitude, this.selectedPin.longitude));
const x = point.x + (this._props.PanelWidth() - this.sidebarWidth()) / 2;
const y = point.y + this._props.PanelHeight() / 2 + 32;
- const cpt = this._props.ScreenToLocalTransform().inverse().transformPoint(x, y);
+ const cpt = this.ScreenToLocalBoxXf().inverse().transformPoint(x, y);
MapAnchorMenu.Instance.jumpTo(cpt[0], cpt[1], true);
document.addEventListener('pointerdown', this.tryHideMapAnchorMenu, true);
@@ -677,7 +677,7 @@ export class MapBoxContainer extends ViewBoxAnnotatableComponent<ViewBoxAnnotata
let target = document.elementFromPoint(e.x, e.y);
while (target) {
if (target === this._ref.current) {
- const cpt = this._props.ScreenToLocalTransform().transformPoint(e.clientX, e.clientY);
+ const cpt = this.ScreenToLocalBoxXf().transformPoint(e.clientX, e.clientY);
const x = cpt[0] - (this._props.PanelWidth() - this.sidebarWidth()) / 2;
const y = cpt[1] - 32 /* height of search bar */ - this._props.PanelHeight() / 2;
const location = this._bingMap.current.tryPixelToLocation(new this.MicrosoftMaps.Point(x, y));