From e427f85decc7949487228ec638993ae77fc1ca2c Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Thu, 18 Feb 2021 14:57:49 -0500 Subject: fixing behavior of windows extending off top and left sides of screen --- src/kernel/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/window.c b/src/kernel/window.c index 9d3db28..4d700bf 100644 --- a/src/kernel/window.c +++ b/src/kernel/window.c @@ -114,7 +114,7 @@ static void paint_and_above(const struct window *w) { for (uint16_t y = ys; y < ym; ++y) for (uint16_t x = xs; x < xm; ++x) - buffer[(y + i->ypos) * VBE_MODE_INFO->width + x + i->xpos] = i->pixel_buffer_pma[y * i->width + x]; + buffer[((y + i->ypos) & 0xffff) * VBE_MODE_INFO->width + ((x + i->xpos) & 0xffff)] = i->pixel_buffer_pma[y * i->width + x]; draw_hz_line(i->ypos - 2, i->xpos - 2, i->xpos + i->width + 2, BORDER_COLOR); draw_hz_line(i->ypos - 1, i->xpos - 2, i->xpos + i->width + 2, BORDER_COLOR); -- cgit v1.2.3