diff --git a/src/viser/_gui_api.py b/src/viser/_gui_api.py index 00319977..a198ea39 100644 --- a/src/viser/_gui_api.py +++ b/src/viser/_gui_api.py @@ -841,7 +841,8 @@ def add_button_group( visible=visible, ), ), - ) + is_button=True, + ), ) def add_checkbox( diff --git a/src/viser/client/src/ThreeAssets.tsx b/src/viser/client/src/ThreeAssets.tsx index 10c4cb2d..cc73912d 100644 --- a/src/viser/client/src/ThreeAssets.tsx +++ b/src/viser/client/src/ThreeAssets.tsx @@ -722,15 +722,18 @@ export const CameraFrustum = React.forwardRef< let z = 1.0; const volumeScale = Math.cbrt((x * y * z) / 3.0); - x /= volumeScale * props.scale; - y /= volumeScale * props.scale; - z /= volumeScale * props.scale; + x /= volumeScale; + y /= volumeScale; + z /= volumeScale; + x *= props.scale; + y *= props.scale; + z *= props.scale; - const hoveredRef = React.useContext(HoverableContext)!; + const hoveredRef = React.useContext(HoverableContext); const [isHovered, setIsHovered] = React.useState(false); useFrame(() => { - if (hoveredRef.current !== isHovered) { + if (hoveredRef !== null && hoveredRef.current !== isHovered) { setIsHovered(hoveredRef.current); } }); @@ -771,12 +774,12 @@ export const CameraFrustum = React.forwardRef< /> {imageTexture && (