X-Git-Url: https://eleni.mutantstargoat.com/git/?p=winnie;a=blobdiff_plain;f=src%2Fgfx.cc;h=45c918befc4602d9300e797b76777ebbf4b5aed8;hp=5c04d1edb3b2856719071f2f0ea75d1d34842cf0;hb=d114b136897ca569d819da5f9b75bd08f9cbe2c0;hpb=a43297a61d69ca5fa5bb7ae8407757da978b4dd4 diff --git a/src/gfx.cc b/src/gfx.cc index 5c04d1e..45c918b 100644 --- a/src/gfx.cc +++ b/src/gfx.cc @@ -92,6 +92,14 @@ void clear_screen(int r, int g, int b) void fill_rect(const Rect &rect, int r, int g, int b) { + if(rect.x < 0) { + rect.x = 0; + } + + if(rect.y < 0) { + rect.y = 0; + } + unsigned char *fb = framebuffer + (rect.x + screen_rect.width * rect.y) * 4; for(int i=0; i