Skip to content

Commit f98b789

Browse files
committed
DM=36291: Bug fix: support pixel distance readout
1 parent 1607b9f commit f98b789

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/firefly/js/drawingLayers/DistanceTool.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -227,23 +227,12 @@ function dealWithMods(drawLayer,action) {
227227

228228

229229
export function getUnitStyle(cc, world) {
230-
if (isUndefined(world)) {
231-
world = hasWCSProjection(cc);
232-
}
233230

234-
if (!world) {
231+
if (!cc || !world) {
235232
return UNIT_PIXEL_ONLY;
236233
} else {
237-
return UNIT_NO_PIXEL;
238-
}
239-
/*
240-
const plot= primePlot(visRoot(),cc.plotId);
241-
const aHiPS = isHiPS(plot);
242-
if (aHiPS) {
243-
return UNIT_NO_PIXEL;
234+
return isHiPS(primePlot(visRoot(),cc.plotId)) ? UNIT_NO_PIXEL : UNIT_ALL;
244235
}
245-
return UNIT_ALL;
246-
*/
247236
}
248237

249238
export function getUnitPreference(unitStyle) {
@@ -317,7 +306,6 @@ function drag(drawLayer,action) {
317306
const {imagePt,plotId}= action.payload;
318307
const plot= primePlot(visRoot(),plotId);
319308
const cc= CsysConverter.make(plot);
320-
if (!cc) return;
321309

322310
const newFirst = drawLayer.moveHead ? drawLayer.firstPt : imagePt;
323311
const newCurrent = drawLayer.moveHead ? imagePt : drawLayer.currentPt;
@@ -449,7 +437,7 @@ function computeDistance(pt1, pt2, cc, pref) {
449437
* @return {Array}
450438
*/
451439
function makeSelectObj(firstPt,currentPt, offsetCal, cc) {
452-
const world = hasWCSProjection(cc);
440+
const world = cc ? hasWCSProjection(cc) : false;
453441
const unitStyle = getUnitStyle(cc, world);
454442
const pref = getUnitPreference(unitStyle);
455443

0 commit comments

Comments
 (0)