From 7f8463455a7c745328e102d19a9877cc48cca8ef Mon Sep 17 00:00:00 2001 From: ThomasBeHappy Date: Sat, 22 Jul 2017 18:49:08 +0200 Subject: [PATCH] Fixed the DrawFilledRectangle --- source/Cosmos.System/Graphics/Canvas.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/Cosmos.System/Graphics/Canvas.cs b/source/Cosmos.System/Graphics/Canvas.cs index 21d67074a..94f6e80fe 100644 --- a/source/Cosmos.System/Graphics/Canvas.cs +++ b/source/Cosmos.System/Graphics/Canvas.cs @@ -325,10 +325,9 @@ namespace Cosmos.System.Graphics public virtual void DrawFilledRectangle(Pen pen, int x_start, int y_start, int width, int height) { - for (int i = 0; i != width; i++) + for (int y = y_start; y < y_start + height; y++) { - DrawLine(pen, x_start, y_start, x_start + height, y_start); - y_start++; + DrawLine(pen, x_start, y, x_start + width - 1, y); } }