@@ -43,7 +43,9 @@ function drawDebugTile(painter, sourceCache, coord) {
4343 const tileRawData = sourceCache . getTileByID ( coord . key ) . latestRawTileData ;
4444 const tileByteLength = ( tileRawData && tileRawData . byteLength ) || 0 ;
4545 const tileSizeKb = Math . floor ( tileByteLength / 1024 ) ;
46- const vertices = createTextVertices ( `${ coord . toString ( ) } ${ tileSizeKb } kb` , 50 , 200 , 5 ) ;
46+ const tileSize = sourceCache . getTile ( coord ) . tileSize ;
47+ const scaleRatio = 512 / Math . min ( tileSize , 512 ) ;
48+ const vertices = createTextVertices ( `${ coord . toString ( ) } ${ tileSizeKb } kb` , 50 , 200 * scaleRatio , 5 * scaleRatio ) ;
4749 const debugTextArray = new PosArray ( ) ;
4850 const debugTextIndices = new LineIndexArray ( ) ;
4951 for ( let v = 0 ; v < vertices . length ; v += 2 ) {
@@ -56,9 +58,21 @@ function drawDebugTile(painter, sourceCache, coord) {
5658
5759 // Draw the halo with multiple 1px lines instead of one wider line because
5860 // the gl spec doesn't guarantee support for lines with width > 1.
59- const tileSize = sourceCache . getTile ( coord ) . tileSize ;
60- const onePixel = EXTENT / ( Math . pow ( 2 , painter . transform . zoom - coord . overscaledZ ) * tileSize ) ;
61- const translations = [ [ - 1 , - 1 ] , [ - 1 , 1 ] , [ 1 , - 1 ] , [ 1 , 1 ] ] ;
61+ const onePixel = EXTENT / ( Math . pow ( 2 , painter . transform . zoom - coord . overscaledZ ) * tileSize * scaleRatio ) ;
62+
63+ const haloWidth = 1 ;
64+ const translations = [ ] ;
65+ for ( let x = - haloWidth ; x <= haloWidth ; x ++ ) {
66+ for ( let y = - haloWidth ; y <= haloWidth ; y ++ ) {
67+ if ( x === 0 && y === 0 ) {
68+ // don't draw the halo at 0,0 since the text is drawn there
69+ break ;
70+ }
71+
72+ translations . push ( [ x , y ] ) ;
73+ }
74+ }
75+
6276 for ( let i = 0 ; i < translations . length ; i ++ ) {
6377 const translation = translations [ i ] ;
6478
0 commit comments