-
Notifications
You must be signed in to change notification settings - Fork 24
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
Prevent mag warning from showing in 3D viewport #6412
Conversation
@@ -50,9 +51,13 @@ export function* watchZ1Downsampling(): Saga<void> { | |||
const minVoxelPerPixel = 0.1; | |||
if (!userClosedWarning) { | |||
// checking only the downsampled dimensions x and y | |||
const is3DViewportFullscreen = yield* select( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the activeViewport
is the one that the mouse hovers currently (or most recently). it's not necessarily in fullscreen then. this means that the toast would likely disappear and re-appear when moving the mouse to the 3d viewport and out of it again.
to get the fullscreen info, I'd do something like the following:
const extent_xy = getViewportExtents(state)["PLANE_XY"];
const extent_yz = getViewportExtents(state)["PLANE_YZ"];
...
const areas = [extent_xy, extent_yz, ...].map(([width, height]) => width * height);
const areDataviewportsInvisible = _.sum(areas) == 0;
could be a helper function next to getViewportExtents
in view_mode_accessors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@philippotto I applied your suggestion, please have a look again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent, works well 👍
The PR fix a small isse whereby a toast warning would show up every time one opened the 3D viewport fullscreen. The message is about not having apprirate data for the loaded mag and does not really make sense when the 3D viewport is in fullscreen mode.
This PR prevents this message from showing when maximizing the 3D viewport.
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)