From d2580a45a4efac06112e500f5093ed69fb7a53e0 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Wed, 30 Oct 2024 17:33:35 -0700 Subject: [PATCH] code rabbit changes --- src/Consolonia.Core/Drawing/DrawingContextImpl.cs | 8 +++----- src/Consolonia.Core/Drawing/RenderTarget.cs | 3 --- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs index 044454d0..72460929 100644 --- a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs +++ b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs @@ -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))); - }, backgroundBrush); + }, ConsoleBrush.FromPosition(brush, x, y, (int)width, (int)height)); }); } } diff --git a/src/Consolonia.Core/Drawing/RenderTarget.cs b/src/Consolonia.Core/Drawing/RenderTarget.cs index 480351ac..16e8f9ab 100644 --- a/src/Consolonia.Core/Drawing/RenderTarget.cs +++ b/src/Consolonia.Core/Drawing/RenderTarget.cs @@ -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 { // buffer re-initialized after resizing