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