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