@@ -441,19 +441,21 @@ export abstract class BaseCrossHair<T extends ICartesianCrosshairSpec | IPolarCr
441441 let x2 = - Infinity ;
442442 let y2 = - Infinity ;
443443 const { x : sx , y : sy } = this . getLayoutStartPoint ( ) ;
444+
444445 bindingAxesIndex . forEach ( idx => {
445446 ( x1 = Infinity ) , ( y1 = Infinity ) , ( x2 = - Infinity ) , ( y2 = - Infinity ) ;
446447 const axis = axesComponents . find ( axis => axis . getSpecIndex ( ) === idx ) ;
447448 if ( ! axis ) {
448449 return ;
449450 }
451+ const innerOffset = ( axis as any ) . getInnerOffset ?.( ) || { left : 0 , right : 0 , top : 0 , bottom : 0 } ;
450452 const regions = axis . getRegions ( ) ;
451453 regions . forEach ( r => {
452454 const { x : regionStartX , y : regionStartY } = r . getLayoutStartPoint ( ) ;
453- x1 = Math . min ( x1 , regionStartX - sx ) ;
454- y1 = Math . min ( y1 , regionStartY - sy ) ;
455- x2 = Math . max ( x2 , regionStartX + r . getLayoutRect ( ) . width - sx ) ;
456- y2 = Math . max ( y2 , regionStartY + r . getLayoutRect ( ) . height - sy ) ;
455+ x1 = Math . min ( x1 , regionStartX - sx + innerOffset . left ) ;
456+ y1 = Math . min ( y1 , regionStartY - sy + innerOffset . top ) ;
457+ x2 = Math . max ( x2 , regionStartX + r . getLayoutRect ( ) . width - sx - innerOffset . right ) ;
458+ y2 = Math . max ( y2 , regionStartY + r . getLayoutRect ( ) . height - sy - innerOffset . bottom ) ;
457459 } ) ;
458460 map . set ( idx , { x1, y1, x2, y2, axis : axis as unknown as T } ) ;
459461 } ) ;
0 commit comments