@aics/vole-app 3.4.0 → 3.4.1
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.
|
@@ -12,6 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
13
|
import { Button, Space } from "antd";
|
|
14
14
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
15
|
+
import { ViewMode } from "../../shared/enums";
|
|
15
16
|
import { applyMatrix, defaultOrientedCamera, getRotationAngles, rotationMatrix, useCameraCallback } from "../../shared/utils/camera";
|
|
16
17
|
import { select, useViewerState } from "../../state/store";
|
|
17
18
|
import { DimensionSliderRow } from "./SliderRows";
|
|
@@ -34,6 +35,7 @@ export var RotationSliders = function RotationSliders(_ref) {
|
|
|
34
35
|
rotation = _useState2[0],
|
|
35
36
|
setRotation = _useState2[1];
|
|
36
37
|
var autorotate = useViewerState(select("autorotate"));
|
|
38
|
+
var viewMode = useViewerState(select("viewMode"));
|
|
37
39
|
var changeViewerSetting = useViewerState(select("changeViewerSetting"));
|
|
38
40
|
|
|
39
41
|
// Set to `true` when user interacts with this component, `false` when they click on the canvas or start autorotate.
|
|
@@ -91,10 +93,10 @@ export var RotationSliders = function RotationSliders(_ref) {
|
|
|
91
93
|
|
|
92
94
|
// Sync down rotation state while this component is "in control."
|
|
93
95
|
useEffect(function () {
|
|
94
|
-
if (hasControlRef.current) {
|
|
96
|
+
if (hasControlRef.current && viewMode === ViewMode.threeD) {
|
|
95
97
|
rotateCameraTo(rotation);
|
|
96
98
|
}
|
|
97
|
-
}, [rotateCameraTo, rotation]);
|
|
99
|
+
}, [rotateCameraTo, rotation, viewMode]);
|
|
98
100
|
|
|
99
101
|
// Set up event listeners on mount.
|
|
100
102
|
useEffect(function () {
|