Skip to content

Commit

Permalink
fix Multi mode on the pencil tool seems to save all annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
YukaUU committed Jul 18, 2024
1 parent 277397e commit 17e6f80
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apps/viewer/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ function initCore() {
}
// for support QUIP 2.0
const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data;
console.log('data', data);

const type = data.provenance.analysis.source;
let body;
let attributes;
Expand Down Expand Up @@ -261,11 +259,11 @@ function initCore() {


// add center position and zoom
if (data.viewerStates != undefined) {
if (data.geometries.features[data.selected].viewerStates != null || data.geometries.features[data.selected].viewerStates != undefined) {

Check failure on line 262 in apps/viewer/init.js

View workflow job for this annotation

GitHub Actions / test

This line has a length of 148. Maximum allowed is 125
const decimalPlaces = 3;
attributes.X = data.viewerStates.x,
attributes.Y = data.viewerStates.y,
attributes.zoom = roundTo(data.viewerStates.zoom, decimalPlaces);
attributes.X = data.geometries.features[data.selected].viewerStates.x,
attributes.Y = data.geometries.features[data.selected].viewerStates.y,
attributes.zoom = roundTo(data.geometries.features[data.selected].viewerStates.z, decimalPlaces);
}
// Rounds a number to the specified number of decimal places.
function roundTo(num, decimalPlaces) {
Expand Down

0 comments on commit 17e6f80

Please sign in to comment.