From 482cf148041acacee21a46d306480d3081013ae3 Mon Sep 17 00:00:00 2001 From: Sebastien DUMETZ Date: Mon, 17 Jun 2024 12:08:13 +0200 Subject: [PATCH] retain pivot point when saving annotation view --- source/client/components/CVAnnotationsTask.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/client/components/CVAnnotationsTask.ts b/source/client/components/CVAnnotationsTask.ts index 438e3720..81447966 100644 --- a/source/client/components/CVAnnotationsTask.ts +++ b/source/client/components/CVAnnotationsTask.ts @@ -179,13 +179,15 @@ export default class CVAnnotationsTask extends CVTask { const machine = this._machine; const props = machine.getTargetProperties(); - const orbitIdx = props.findIndex((elem) => {return elem.name == "Orbit"}); - const offsetIdx = props.findIndex((elem) => {return elem.name == "Offset"}); + const retainIdx = []; + for(let i = 0; i < props.length; i++) { + if(["Pivot", "Orbit", "Offset"].includes(props[i].name)) retainIdx.push(i); + } // set non camera properties to null to skip them const values = machine.getCurrentValues(); values.forEach((v, idx) => { - if(idx != orbitIdx && idx != offsetIdx) { + if(!retainIdx.includes(idx)) { values[idx] = null; } });