@@ -331,8 +331,8 @@ public static BitmapImage RenderBitmap(ReadOnlySpan<char> text, Dye textDye, Dye
331331
332332 internal static ( int Width , int Height ) CalculateDimensions ( int charCount , int scale )
333333 {
334- var textWidth = ( charCount * ( CharWidth + CharSpacing ) * scale ) - ( CharSpacing * scale ) ;
335- return ( Math . Max ( textWidth , 0 ) + ( Padding * 2 ) , ( CharHeight * scale ) + ( Padding * 2 ) ) ;
334+ var textWidth = charCount * ( CharWidth + CharSpacing ) * scale - CharSpacing * scale ;
335+ return ( Math . Max ( textWidth , 0 ) + Padding * 2 , CharHeight * scale + Padding * 2 ) ;
336336 }
337337
338338 private static char [ ] ExtractRenderableChars ( ReadOnlySpan < char > text )
@@ -371,7 +371,7 @@ internal static void RenderGlyph(bool[] bitmap, int width, byte[] glyph, int x,
371371 var glyphRow = glyph [ row ] ;
372372 for ( var col = 0 ; col < CharWidth ; col ++ )
373373 if ( ( glyphRow & ( 1 << ( CharWidth - 1 - col ) ) ) != 0 )
374- FillPixel ( bitmap , width , x + ( col * scale ) , y + ( row * scale ) , scale ) ;
374+ FillPixel ( bitmap , width , x + col * scale , y + row * scale , scale ) ;
375375 }
376376 }
377377
@@ -386,8 +386,9 @@ private static void FillPixel(bool[] bitmap, int width, int x, int y, int scale)
386386 var col = x + dx ;
387387 if ( row < 0 || col < 0 || width <= 0 || row >= height || col >= width )
388388 continue ;
389- var pixelIndex = ( row * width ) + col ;
390- if ( pixelIndex < bitmap . Length ) bitmap [ pixelIndex ] = true ;
389+ var pixelIndex = row * width + col ;
390+ if ( pixelIndex < bitmap . Length )
391+ bitmap [ pixelIndex ] = true ;
391392 }
392393 }
393394 }
0 commit comments