Skip to content

Commit

Permalink
use mpp to get w and h
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Sep 13, 2023
1 parent 0fa7541 commit 321b919
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/labeling/pitfalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,8 +1371,14 @@ function resetForm() {
// TODO the form should start inactive until a roi is created.
function addAnnot(e) {
if (!$D.activeROI) {
let halfWidth = 1996/2;
let halfHeight = 1996/2;
// defaults in case no mpp
let halfWidth = 1000;
let halfHeight = 1000;
// should be 500 microns; so half is 250 divided by microns per pixel, get width and height in pixels
if ($CAMIC.slideData.mpp){

Check failure on line 1378 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 1378 in apps/labeling/pitfalls.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Missing space before opening brace
halfWidth = 250/$CAMIC.slideData.mpp;
halfHeight = 250/$CAMIC.slideData.mpp;
}
let ctr = $CAMIC.viewer.viewport.viewportToImageCoordinates($CAMIC.viewer.viewport.pointFromPixel(e.position, true));
let xCtr = Math.round(ctr.x);
let yCtr = Math.round(ctr.y);
Expand Down

0 comments on commit 321b919

Please sign in to comment.