Skip to content

Commit 0316fea

Browse files
committed
Bug fix: ActiveRowWatch not supporting ssa type coordinates
1 parent 6b90ff9 commit 0316fea

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/firefly/js/visualize/saga/ActiveRowCenterWatcher.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,23 @@ function toAngle(d, radianToDegree) {
149149
export function getRowCenterWorldPt(tableOrId) {
150150
const tbl= getTableModel(tableOrId);
151151
if (!tbl) return;
152-
const cenCol= findTableCenterColumns(tbl);
152+
const cenCol= findTableCenterColumns(tbl,true);
153153
if (!cenCol) return;
154154
const {lonCol,latCol,csys}= cenCol;
155-
const rad= isTableUsingRadians(tbl, [lonCol,latCol]);
156-
const lon= toAngle(getCellValue(tbl,tbl.highlightedRow, lonCol),rad);
157-
const lat= toAngle(getCellValue(tbl,tbl.highlightedRow, latCol),rad);
155+
156+
let lon;
157+
let lat;
158+
159+
if (lonCol===latCol) {
160+
const latlonAry= getCellValue(tbl,tbl.highlightedRow, lonCol);
161+
lon= toAngle(latlonAry[0],false);
162+
lat= toAngle(latlonAry[1],false);
163+
}
164+
else {
165+
const rad= isTableUsingRadians(tbl, [lonCol,latCol]);
166+
lon= toAngle(getCellValue(tbl,tbl.highlightedRow, lonCol),rad);
167+
lat= toAngle(getCellValue(tbl,tbl.highlightedRow, latCol),rad);
168+
}
158169
if (isNaN(lon) || isNaN(lat)) return;
159170
return makeAnyPt(lon,lat,csys||CoordinateSys.EQ_J2000);
160171
}

0 commit comments

Comments
 (0)