3
3
*/
4
4
5
5
import update from 'react-addons-update' ;
6
- import { isEmpty , isUndefined } from 'lodash' ;
6
+ import { isEmpty , isNil , isUndefined } from 'lodash' ;
7
7
import Cntlr , { ExpandType } from '../ImagePlotCntlr.js' ;
8
8
import PlotView , { replacePlotView , replacePrimaryPlot , changePrimePlot ,
9
9
findWCSMatchOffset , updatePlotViewScrollXY } from './PlotView.js' ;
@@ -287,26 +287,26 @@ function updateViewSize(state,action) {
287
287
288
288
function recenter ( state , action ) {
289
289
const { plotId, centerPt} = action . payload ;
290
- var { plotGroupAry, plotViewAry, wcsMatchCenterWP } = state ;
290
+ var { plotGroupAry, plotViewAry} = state ;
291
291
const pv = getPlotViewById ( state , plotId ) ;
292
292
var plotGroup = findPlotGroup ( pv . plotGroupId , plotGroupAry ) ;
293
293
294
- plotViewAry = applyToOnePvOrGroup ( plotViewAry , plotId , plotGroup , recenterPv ( centerPt , wcsMatchCenterWP ) ) ;
294
+ plotViewAry = applyToOnePvOrGroup ( plotViewAry , plotId , plotGroup , recenterPv ( centerPt ) ) ;
295
295
return clone ( state , { plotViewAry} ) ;
296
296
}
297
297
298
298
/**
299
299
* Center on the FIXED_TARGET attribute or the center of the plot or specified center point
300
300
* @param centerPt center point
301
- * @param wcsMatchCenterWP wcs match point if it exist
302
301
* @return {{} } a new plot view
303
302
*/
304
303
305
- function recenterPv ( centerPt , wcsMatchCenterWP ) {
304
+ function recenterPv ( centerPt ) {
306
305
return ( pv ) => {
307
306
const plot = primePlot ( pv ) ;
308
307
if ( ! plot ) return pv ;
309
308
var centerImagePt ;
309
+ const useBoundsChecking = isNil ( centerPt ) ; // will use bounds checking if centerPt is not passed
310
310
311
311
if ( centerPt ) {
312
312
if ( centerPt . type === Point . IM_PT ) {
@@ -323,7 +323,7 @@ function recenterPv(centerPt, wcsMatchCenterWP) {
323
323
centerImagePt = makeImagePt ( plot . dataWidth / 2 , plot . dataHeight / 2 ) ;
324
324
}
325
325
}
326
- return updatePlotViewScrollXY ( pv , PlotView . findScrollPtForImagePt ( pv , centerImagePt ) ) ;
326
+ return updatePlotViewScrollXY ( pv , PlotView . findScrollPtForImagePt ( pv , centerImagePt , useBoundsChecking ) ) ;
327
327
} ;
328
328
}
329
329
0 commit comments