Skip to content

Commit

Permalink
fix: 2D axes labels disappears when max zoom in. #2229 (#2230)
Browse files Browse the repository at this point in the history
Co-authored-by: Christophe Winkler <christophe.winkler@aspentech.com>
Co-authored-by: t0oF <93762994+w1nklr@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 16, 2024
1 parent b09d6f4 commit 95d557c
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 82 deletions.
7 changes: 6 additions & 1 deletion typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1679,13 +1679,18 @@ function computeViewState(
};
return updateViewState(defaultCamera, boundingBox, size);
} else {
const is3D = false;

// If the camera is defined, use it
if (isCameraPositionDefined) {
const is3D = false;
return updateViewState(cameraPosition, boundingBox, size, is3D);
}

const centerOfData: [number, number, number] = boxCenter(boundingBox);

// In 2D set camera target (centerOfDatea) to 0; Zoom scales world around target.
centerOfData[2] = 0;

// if bounds are defined, use them
if (isBoundsDefined) {
return getViewStateFromBounds(
Expand Down
Loading

0 comments on commit 95d557c

Please sign in to comment.