Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: need to reset twice to go back (#2151) #2173

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: need to reset twice to go back (#2151)
  • Loading branch information
DShamakin committed Jul 26, 2024
commit eb15e493a6e0fe25bbb91d27bc040d46de3227c4
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
Loading