From 50e3f6daf627d72a500b07f053cb34f713f0c650 Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Sun, 24 Feb 2013 20:03:01 +0200 Subject: [PATCH] *in progress* fixed fill_rect boundaries --- src/fbdev/gfx.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fbdev/gfx.cc b/src/fbdev/gfx.cc index c207b0c..2b1c32a 100644 --- a/src/fbdev/gfx.cc +++ b/src/fbdev/gfx.cc @@ -96,18 +96,20 @@ void fill_rect(const Rect &rect, int r, int g, int b) Rect drect = rect; if(drect.x < screen_rect.x) { + drect.width -= screen_rect.x - drect.x; drect.x = screen_rect.x; } if(drect.y < screen_rect.y) { + drect.height -= screen_rect.y - drect.y; drect.y = screen_rect.y; } - if(drect.x + drect.width > screen_rect.width) { + if(drect.x + drect.width >= screen_rect.x + screen_rect.width) { drect.width = screen_rect.width - drect.x; } - if(drect.y + drect.height > screen_rect.height) { + if(drect.y + drect.height >= screen_rect.y + screen_rect.height) { drect.height = screen_rect.height - drect.y; } -- 1.7.10.4