Skip to content

Commit

Permalink
mpp alert on load, not on annot save
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Sep 14, 2023
1 parent 02853c5 commit 214fb40
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/labeling/pitfalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ async function initialize() {
});
// add dbl click handler
$CAMIC.viewer.addHandler('canvas-double-click', addAnnot);
// alert and return if no mpp
if (!$CAMIC.slideData.mpp){

Check failure on line 199 in apps/labeling/pitfalls.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing space before opening brace

Check failure on line 199 in apps/labeling/pitfalls.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
alert("This image doesn't have the microns per pixel (mpp) defined. Please resolve this issue before working with this image.");
window.location = `./pitfallsTable.html?collectionId=${$D.params.collectionId}`;
}
}
}, 500);
}
Expand Down Expand Up @@ -1379,10 +1384,6 @@ function addAnnot(e) {
if ($CAMIC.slideData.mpp){
halfWidth = Math.floor(250/$CAMIC.slideData.mpp);
halfHeight = Math.floor(250/$CAMIC.slideData.mpp);
} else {
// alert and return
alert("This image doesn't have the microns per pixel (mpp) defined. Please resolve this issue before working with this image.");
window.location = `./pitfallsTable.html?collectionId=${$D.params.collectionId}`;
}
let ctr = $CAMIC.viewer.viewport.viewportToImageCoordinates($CAMIC.viewer.viewport.pointFromPixel(e.position, true));
let xCtr = Math.round(ctr.x);
Expand Down

0 comments on commit 214fb40

Please sign in to comment.