@archvisioninc/canvas 2.8.2 → 2.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -631,13 +631,18 @@ export const takePreviewScreenshots = () => {
631
631
  scaleGizmoEnabled
632
632
  } = gizmoManager;
633
633
  const toggleUI = restore => {
634
- mirrorGround.isVisible = restore ? mirrorGroundVisible : false;
635
- ground.isVisible = restore ? groundVisible : false;
636
- xAxisMesh.isVisible = restore ? axesVisible : false;
637
- yAxisMesh.isVisible = restore ? axesVisible : false;
638
- zAxisMesh.isVisible = restore ? axesVisible : false;
639
- hdrSkyBox.isVisible = restore ? skyBoxVisible : false;
640
- outerFrame.isVisible = restore ? frameVisible : false;
634
+ const setVisibility = (object, isVisible) => {
635
+ if (object !== null && object !== undefined) {
636
+ object.isVisible = isVisible;
637
+ }
638
+ };
639
+ setVisibility(mirrorGround, restore ? mirrorGroundVisible : false);
640
+ setVisibility(ground, restore ? groundVisible : false);
641
+ setVisibility(xAxisMesh, restore ? axesVisible : false);
642
+ setVisibility(yAxisMesh, restore ? axesVisible : false);
643
+ setVisibility(zAxisMesh, restore ? axesVisible : false);
644
+ setVisibility(hdrSkyBox, restore ? skyBoxVisible : false);
645
+ setVisibility(outerFrame, restore ? frameVisible : false);
641
646
  gizmoManager.positionGizmoEnabled = restore ? positionGizmoEnabled : false;
642
647
  gizmoManager.rotationGizmoEnabled = restore ? rotationGizmoEnabled : false;
643
648
  gizmoManager.boundingBoxGizmoEnabled = restore ? boundingBoxGizmoEnabled : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archvisioninc/canvas",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "private": false,
5
5
  "main": "dist/Canvas.js",
6
6
  "module": "dist/Canvas.js",
@@ -696,13 +696,20 @@ export const takePreviewScreenshots = () => {
696
696
  } = gizmoManager;
697
697
 
698
698
  const toggleUI = restore => {
699
- mirrorGround.isVisible = restore ? mirrorGroundVisible : false;
700
- ground.isVisible = restore ? groundVisible : false;
701
- xAxisMesh.isVisible = restore ? axesVisible : false;
702
- yAxisMesh.isVisible = restore ? axesVisible : false;
703
- zAxisMesh.isVisible = restore ? axesVisible : false;
704
- hdrSkyBox.isVisible = restore ? skyBoxVisible : false;
705
- outerFrame.isVisible = restore ? frameVisible : false;
699
+ const setVisibility = (object, isVisible) => {
700
+ if (object !== null && object !== undefined) {
701
+ object.isVisible = isVisible;
702
+ }
703
+ };
704
+
705
+ setVisibility(mirrorGround, restore ? mirrorGroundVisible : false);
706
+ setVisibility(ground, restore ? groundVisible : false);
707
+ setVisibility(xAxisMesh, restore ? axesVisible : false);
708
+ setVisibility(yAxisMesh, restore ? axesVisible : false);
709
+ setVisibility(zAxisMesh, restore ? axesVisible : false);
710
+ setVisibility(hdrSkyBox, restore ? skyBoxVisible : false);
711
+ setVisibility(outerFrame, restore ? frameVisible : false);
712
+
706
713
  gizmoManager.positionGizmoEnabled = restore ? positionGizmoEnabled : false;
707
714
  gizmoManager.rotationGizmoEnabled = restore ? rotationGizmoEnabled : false;
708
715
  gizmoManager.boundingBoxGizmoEnabled = restore ? boundingBoxGizmoEnabled : false;