Fix issue with gimbal controls when preview disabled

This commit is contained in:
JannisX11 2021-02-28 15:57:55 +01:00
parent 8f6cae31f1
commit b2bb3e3e51

View File

@ -1275,6 +1275,7 @@ class GimbalControls {
if (side.label) side.node.innerText = side.label;
side.node.addEventListener('click', e => {
if (!this.preview.controls.enabled) return;
let preset_key = key == this.preview.angle ? side.opposite : key;
let preset = DefaultCameraPresets.find(p => p.id == preset_key);
this.preview.loadAnglePreset(preset);
@ -1284,7 +1285,7 @@ class GimbalControls {
// Interact
addEventListeners(this.node, 'mousedown touchstart', e1 => {
if (!scope.preview.controls.enableRotate || !scope.preview.controls.enabled || scope.preview.angle != null) return;
if ((!scope.preview.controls.enableRotate && scope.preview.angle == null) || !scope.preview.controls.enabled) return;
convertTouchEvent(e1);
let last_event = e1;
let move_calls = 0;