Repository navigation
feat: Remote rendering 4.6: Keep view fitted to the canvas on resize - #189
Open
LKasianAnsys wants to merge 4 commits into
Open
LKasianAnsys wants to merge 4 commits into
LKasianAnsys wants to merge 4 commits into
Conversation
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 26, 2026 14:17
cff2f15 to
5537068
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 26, 2026 17:33
5537068 to
b56dbbd
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 26, 2026 19:45
b56dbbd to
d243b28
Compare
LKasianAnsys
marked this pull request as ready for review
October 26, 2026 20:37
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 28, 2026 14:10
d243b28 to
9f57271
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 28, 2026 16:17
9f57271 to
fae445b
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 28, 2026 16:31
fae445b to
4f3c7ba
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
2 times, most recently
from
October 29, 2026 21:51
fbe0192 to
53bce2c
Compare
LKasianAnsys
force-pushed
the
feat/4.6-fit-view-to-canvas
branch
from
October 29, 2026 23:11
394cb8c to
9ac6f15
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Resolves #31
Context
Until now, the orthographic view ruler's displayed scale value did not adjust with the canvas in SERVER mode, and the orientation widget did not resize with the canvas in either CLIENT or SERVER mode. In this PR, the ruler on every canvas resize change. The orientation widget is now set to 0.15x the canvas's shorter side in both modes.
Manual check,
In SERVER mode: Start a VISOR session with a dataset and with a unit passed via Metadata. Turn on the orthographic view, and see the ruler. Zoom in and out, and/or resize the canvas window. Notice the scale value updates accordingly.
In SERVER and CLIENT mode: Start a VISOR session with a dataset. Resize the window; the orientation widget scales with the canvas size.
Copilot summary
This pull request introduces improvements to how the orientation widget is sized and kept in sync with the render window during resizes, as well as infrastructure to notify listeners of canvas resizes and propagate those changes through the rendering pipeline. It also adds comprehensive tests to ensure correct resize handling and updates the server and client code to keep the view and camera state consistent after resizes.
Orientation widget sizing and resize propagation:
fit_to_windowmethod toVisorOrientationWidgetand invoking it during viewport size changes. [1] [2] [3] [4]Canvas resize event infrastructure:
IServerCanvasinterface and its implementation now supportaddResizeListener, allowing other components to be notified when the canvas is resized to a non-zero size. This infrastructure is used to trigger camera state updates and widget resizing in response to user or system-initiated resizes. [1] [2] [3] [4] [5] [6]Renderer and camera state updates:
ServerRenderer) now listens for canvas resize events and updates all camera listeners with the new viewport height, ensuring camera state remains accurate. The viewport height calculation is now truncated to match server-side sizing. [1] [2] [3] [4]Frontend and widget integration:
WasmRenderer), and unused or commented-out code related to orientation widget instantiation in the frontend has been cleaned up. [1] [2] [3] [4] [5]Testing and validation:
These changes together provide a robust and extensible mechanism for handling canvas and window resizes, keeping the UI elements and camera state in sync with the underlying render window.