From eb15e493a6e0fe25bbb91d27bc040d46de3227c4 Mon Sep 17 00:00:00 2001 From: DShamakin Date: Fri, 26 Jul 2024 13:08:42 +0500 Subject: [PATCH] fix: need to reset twice to go back (#2151) --- .../well-log-viewer/src/components/WellLogView.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx index a69817d82..9c0afb612 100644 --- a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx +++ b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx @@ -1267,6 +1267,8 @@ class WellLogView selPinned: number | undefined; // pinned position selPersistent: boolean | undefined; + isDefZoom: boolean; + template: Template; scaleInterpolator: ScaleInterpolator | undefined; @@ -1281,6 +1283,8 @@ class WellLogView this.selPinned = undefined; this.selPersistent = undefined; + this.isDefZoom = false; + this.resizeObserver = new ResizeObserver( (entries: ResizeObserverEntry[]): void => { const entry = entries[0]; @@ -1554,6 +1558,7 @@ class WellLogView setControllerDefaultZoom(): void { if (this.props.domain) this.zoomContentTo(this.props.domain); else this.zoomContentTo(this.getContentBaseDomain()); + this.isDefZoom = true; } /** @@ -1610,6 +1615,10 @@ class WellLogView return zoomContentTo(this.logController, domain); } scrollContentTo(f: number): boolean { + if (this.isDefZoom) { + this.isDefZoom = false; + return false; + } if (!this.logController) return false; return scrollContentTo(this.logController, f); }