Skip to content

Commit

Permalink
Merge pull request #64 from Carifio24/ipv-resolution-scatter-layers
Browse files Browse the repository at this point in the history
Account for scatter layers when determining ipyvolume volume resolution
  • Loading branch information
Carifio24 authored Oct 3, 2024
2 parents 543ba63 + 1f9a0c1 commit 5a6f7eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion glue_ar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def get_resolution(viewer_state: Viewer3DState) -> int:
try:
from glue_jupyter.common.state3d import VolumeViewerState
if isinstance(viewer_state, VolumeViewerState):
return max((getattr(state, 'max_resolution', 256) for state in viewer_state.layers), default=256)
resolutions = tuple(getattr(state, 'max_resolution', None) for state in viewer_state.layers)
return max((res for res in resolutions if res is not None), default=256)
except ImportError:
pass

Expand Down

0 comments on commit 5a6f7eb

Please sign in to comment.