Skip to content

Commit

Permalink
code rabbit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlm committed Oct 31, 2024
1 parent c5d315c commit d2580a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/Consolonia.Core/Drawing/DrawingContextImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,20 @@ public void DrawGeometry(IBrush brush, IPen pen, IGeometryImpl geometry)

Rect r2 = r.TransformToAABB(Transform);

(double top, double left) = r2.TopLeft;
var width = r2.Width + (pen?.Thickness ?? 0);
var height = r2.Height + (pen?.Thickness ?? 0);
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
{
int px = (int)(top + x);
int py = (int)(left + y);
int px = (int)(r2.TopLeft.X + x);
int py = (int)(r2.TopLeft.Y + y);
CurrentClip.ExecuteWithClipping(new Point(px, py), () =>
{
ConsoleBrush backgroundBrush = ConsoleBrush.FromPosition(brush, x, y, (int)width, (int)height);
_pixelBuffer.Set(new PixelBufferCoordinate((ushort)px, (ushort)py),
(pixel, bb) =>
{
return pixel.Blend(new Pixel(new PixelBackground(bb.Mode, bb.Color)));

Check warning on line 145 in src/Consolonia.Core/Drawing/DrawingContextImpl.cs

View workflow job for this annotation

GitHub Actions / build

"[AccessToModifiedClosure] Captured variable is modified in the outer scope" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/DrawingContextImpl.cs(145,93)

Check warning on line 145 in src/Consolonia.Core/Drawing/DrawingContextImpl.cs

View workflow job for this annotation

GitHub Actions / build

"[AccessToModifiedClosure] Captured variable is modified in the outer scope" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/DrawingContextImpl.cs(145,96)
}, backgroundBrush);
}, ConsoleBrush.FromPosition(brush, x, y, (int)width, (int)height));

Check warning on line 146 in src/Consolonia.Core/Drawing/DrawingContextImpl.cs

View workflow job for this annotation

GitHub Actions / build

"[AccessToModifiedClosure] Captured variable is modified in the outer scope" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/DrawingContextImpl.cs(146,69)

Check warning on line 146 in src/Consolonia.Core/Drawing/DrawingContextImpl.cs

View workflow job for this annotation

GitHub Actions / build

"[AccessToModifiedClosure] Captured variable is modified in the outer scope" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/DrawingContextImpl.cs(146,72)
});
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/Consolonia.Core/Drawing/RenderTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ private void RenderToDevice()
if (pixel.Background.Mode != PixelBackgroundMode.Colored)
throw new InvalidOperationException("All pixels in the buffer must have exact console color before rendering");

if (x == pixelBuffer.Width - 1 && y == pixelBuffer.Height - 1)
break;

if (pixel.Foreground.Symbol is null) // not using 'when' as it swallows the exceptions

Check warning on line 121 in src/Consolonia.Core/Drawing/RenderTarget.cs

View workflow job for this annotation

GitHub Actions / build

"[BadChildStatementIndent] Line indent is not restored to the previous level around child statement" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/RenderTarget.cs(121,1)
{
// buffer re-initialized after resizing

Check warning on line 123 in src/Consolonia.Core/Drawing/RenderTarget.cs

View workflow job for this annotation

GitHub Actions / build

"[BadChildStatementIndent] Line indent is not restored to the previous level around child statement" on /home/runner/work/Consolonia/Consolonia/src/Consolonia.Core/Drawing/RenderTarget.cs(123,1)
Expand Down

0 comments on commit d2580a4

Please sign in to comment.