Skip to content

Commit

Permalink
fix: regression in viewport size (#1839)
Browse files Browse the repository at this point in the history
Fix regression in viewport size introduced in PR #1837
  • Loading branch information
w1nklr committed Dec 19, 2023
1 parent 0e9066f commit 8d8eb7d
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ const Map: React.FC<MapProps> = ({
return (item as Layer).clone({
// Inject "dispatchBoundingBox" function into layer for it to report back its respective bounding box.
// eslint-disable-next-line
// @ts-ignore
// @ts-ignore
reportBoundingBox: dispatchBoundingBox,
// Set "modelLayer" matrix to reflect correct z scaling.
modelMatrix: m,
Expand Down Expand Up @@ -1060,20 +1060,6 @@ class ViewController {
const newViews = this.getDeckGlViews(views, fullState);
const newViewState = this.getDeckGlViewState(views, fullState);

if (
this.result_.views !== newViews ||
this.result_.viewState !== newViewState
) {
const viewsMsg = this.result_.views !== newViews ? " views" : "";
const stateMsg =
this.result_.viewState !== newViewState ? " state" : "";
const linkMsg = viewsMsg && stateMsg ? " and" : "";

console.log(
`ViewController returns new${viewsMsg}${linkMsg}${stateMsg}`
);
}

this.state_ = fullState;
this.views_ = views;
this.result_.views = newViews;
Expand Down Expand Up @@ -1489,7 +1475,7 @@ function buildDeckGlViews(views: ViewsType | undefined, size: Size): View[] {
const singleView = nX === 1 && nY === 1;
if (singleView) {
// Using 99.5% of viewport to avoid flickering of deckgl canvas
return [newView(views.viewports[0], 0, 0, "95%", "95%")];
return [newView(views.viewports[0], 0, 0, "99.5%", "99.5%")];
}

// compute for matrix
Expand Down

0 comments on commit 8d8eb7d

Please sign in to comment.