@@ -30,9 +30,6 @@ export class GridRenderer {
3030 // Default radius in pixels for corners for some elements (like the active cell)
3131 static DEFAULT_EDGE_RADIUS = 2 ;
3232
33- // Default width in pixels for the border of the active cell
34- static ACTIVE_CELL_BORDER_WIDTH = 2 ;
35-
3633 protected textCellRenderer = new TextCellRenderer ( ) ;
3734
3835 protected dataBarCellRenderer = new DataBarCellRenderer ( ) ;
@@ -2151,11 +2148,18 @@ export class GridRenderer {
21512148 context : CanvasRenderingContext2D ,
21522149 state : GridRenderState ,
21532150 column : VisibleIndex ,
2154- row : VisibleIndex ,
2155- borderWidth = GridRenderer . ACTIVE_CELL_BORDER_WIDTH
2151+ row : VisibleIndex
21562152 ) : void {
21572153 const { metrics, theme } = state ;
2158- const { allColumnWidths, allColumnXs, allRowHeights, allRowYs } = metrics ;
2154+ const {
2155+ scrollX,
2156+ scrollY,
2157+ allColumnWidths,
2158+ allColumnXs,
2159+ allRowHeights,
2160+ allRowYs,
2161+ } = metrics ;
2162+ const { activeCellSelectionBorderWidth : borderWidth } = theme ;
21592163 const cellX = getOrThrow ( allColumnXs , column ) ;
21602164 const cellY = getOrThrow ( allRowYs , row ) ;
21612165 const cellW = getOrThrow ( allColumnWidths , column ) ;
@@ -2168,13 +2172,13 @@ export class GridRenderer {
21682172 let h = cellH + borderWidth ;
21692173
21702174 // Make sure the outline is interior on the edge
2171- if ( x <= 0 ) {
2172- w += x - 1 ;
2173- x = 1 ;
2175+ if ( x <= 0 && scrollX <= 0 ) {
2176+ w -= borderWidth - x ;
2177+ x = borderWidth * 0.5 ;
21742178 }
2175- if ( y <= 0 ) {
2176- h += y - 1 ;
2177- y = 1 ;
2179+ if ( y <= 0 && scrollY <= 0 ) {
2180+ h -= borderWidth - y ;
2181+ y = borderWidth * 0.5 ;
21782182 }
21792183
21802184 const { lineWidth } = context ;
0 commit comments