Skip to content

Commit c2bd639

Browse files
author
Cindy Wang
committed
Merge branch 'dev' of https://github.com/Caltech-IPAC/firefly into dev
2 parents 44f65d5 + 7a89fa1 commit c2bd639

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/firefly/js/visualize/reducer/HandlePlotChange.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import update from 'react-addons-update';
6-
import {isEmpty,isUndefined} from 'lodash';
6+
import {isEmpty,isNil, isUndefined} from 'lodash';
77
import Cntlr, {ExpandType} from '../ImagePlotCntlr.js';
88
import PlotView, {replacePlotView, replacePrimaryPlot, changePrimePlot,
99
findWCSMatchOffset, updatePlotViewScrollXY} from './PlotView.js';
@@ -287,26 +287,26 @@ function updateViewSize(state,action) {
287287

288288
function recenter(state,action) {
289289
const {plotId, centerPt}= action.payload;
290-
var {plotGroupAry,plotViewAry, wcsMatchCenterWP}= state;
290+
var {plotGroupAry,plotViewAry}= state;
291291
const pv= getPlotViewById(state,plotId);
292292
var plotGroup= findPlotGroup(pv.plotGroupId,plotGroupAry);
293293

294-
plotViewAry= applyToOnePvOrGroup(plotViewAry,plotId,plotGroup, recenterPv(centerPt, wcsMatchCenterWP));
294+
plotViewAry= applyToOnePvOrGroup(plotViewAry,plotId,plotGroup, recenterPv(centerPt));
295295
return clone(state,{plotViewAry});
296296
}
297297

298298
/**
299299
* Center on the FIXED_TARGET attribute or the center of the plot or specified center point
300300
* @param centerPt center point
301-
* @param wcsMatchCenterWP wcs match point if it exist
302301
* @return {{}} a new plot view
303302
*/
304303

305-
function recenterPv(centerPt, wcsMatchCenterWP) {
304+
function recenterPv(centerPt) {
306305
return (pv) => {
307306
const plot = primePlot(pv);
308307
if (!plot) return pv;
309308
var centerImagePt;
309+
const useBoundsChecking= isNil(centerPt); // will use bounds checking if centerPt is not passed
310310

311311
if (centerPt) {
312312
if (centerPt.type === Point.IM_PT) {
@@ -323,7 +323,7 @@ function recenterPv(centerPt, wcsMatchCenterWP) {
323323
centerImagePt = makeImagePt(plot.dataWidth / 2, plot.dataHeight / 2);
324324
}
325325
}
326-
return updatePlotViewScrollXY(pv, PlotView.findScrollPtForImagePt(pv, centerImagePt));
326+
return updatePlotViewScrollXY(pv, PlotView.findScrollPtForImagePt(pv, centerImagePt, useBoundsChecking));
327327
};
328328
}
329329

0 commit comments

Comments
 (0)