Skip to content

Commit

Permalink
Automated JetBrains cleanup
Browse files Browse the repository at this point in the history
Co-authored-by:  <[email protected]>
  • Loading branch information
github-actions[bot] committed Jan 5, 2024
1 parent 339b15d commit ac84182
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/Consolonia.Core/Drawing/DrawingContextImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void DrawPixelAndMoveHead(int count)
{
Point characterPoint = whereToDraw.Transform(Matrix.CreateTranslation(currentXPosition++, 0));
ConsoleColor foregroundColor = consoleColorBrush.Color;

if (additionalBrushes != null)
{
(FormattedText.FBrushRange _, IBrush brush) = additionalBrushes.FirstOrDefault(pair =>
Expand All @@ -414,48 +414,48 @@ void DrawPixelAndMoveHead(int count)
char character = str[i];

switch (character)
{
case '\t':
{
case '\t':
const int tabSize = 8;
var consolePixel = new Pixel(' ', foregroundColor);
for (int j = 0; j < tabSize; j++)
{
const int tabSize = 8;
var consolePixel = new Pixel(' ', foregroundColor);
for (int j = 0; j < tabSize; j++)
Point newCharacterPoint = characterPoint.WithX(characterPoint.X + j);
CurrentClip.ExecuteWithClipping(newCharacterPoint, () =>
{
Point newCharacterPoint = characterPoint.WithX(characterPoint.X + j);
CurrentClip.ExecuteWithClipping(newCharacterPoint, () =>
{
_pixelBuffer.Set((PixelBufferCoordinate)newCharacterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);
});
}

currentXPosition += tabSize - 1;
}
break;
case '\n':
{
/* it's not clear if we need to draw anything. Cursor can be placed at the end of the line
var consolePixel = new Pixel(' ', foregroundColor);
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);*/
}
break;
case '\u200B':
currentXPosition--;
break;
default:
{
var consolePixel = new Pixel(character, foregroundColor);
CurrentClip.ExecuteWithClipping(characterPoint, () =>
{
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);
}
);
_pixelBuffer.Set((PixelBufferCoordinate)newCharacterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);
});
}
break;

currentXPosition += tabSize - 1;
}
break;
case '\n':
{
/* it's not clear if we need to draw anything. Cursor can be placed at the end of the line
var consolePixel = new Pixel(' ', foregroundColor);
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);*/
}
break;
case '\u200B':
currentXPosition--;
break;
default:
{
var consolePixel = new Pixel(character, foregroundColor);
CurrentClip.ExecuteWithClipping(characterPoint, () =>
{
_pixelBuffer.Set((PixelBufferCoordinate)characterPoint,
(oldPixel, cp) => oldPixel.Blend(cp), consolePixel);
}
);
}
break;
}
}
}
}
Expand Down

0 comments on commit ac84182

Please sign in to comment.