Skip to content

Commit

Permalink
fix: need to reset twice to go back (equinor#2151)
Browse files Browse the repository at this point in the history
  • Loading branch information
DShamakin committed Jul 26, 2024
1 parent dec58b0 commit eb15e49
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,8 @@ class WellLogView
selPinned: number | undefined; // pinned position
selPersistent: boolean | undefined;

isDefZoom: boolean;

template: Template;

scaleInterpolator: ScaleInterpolator | undefined;
Expand All @@ -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];
Expand Down Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit eb15e49

Please sign in to comment.