diff options
author | Sven Schnelle <svens@stackframe.org> | 2020-08-08 20:51:57 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2020-08-26 23:04:00 +0200 |
commit | 2f8cd515477edab1cbf38ecbdbfa2cac13ce1550 (patch) | |
tree | 38818fc65b908e1818a44eef14f19f2ee87441f9 /hw | |
parent | f9e9f7149027906785949d49b4e4c9b9ec896203 (diff) |
hw/display/artist: Fix invalidation of lines near screen border
If parts of the invalidated screen lines are outside of the VRAM buffer,
the code skips the whole invalidate. This is incorrect when only parts
of the buffer are invisble - which is the case when the mouse cursor is
located near the screen border.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/artist.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/display/artist.c b/hw/display/artist.c index a959b2c158..71982559c6 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -206,7 +206,12 @@ static void artist_invalidate_lines(struct vram_buffer *buf, int starty, int height) { int start = starty * buf->width; - int size = height * buf->width; + int size; + + if (starty + height > buf->height) + height = buf->height - starty; + + size = height * buf->width; if (start + size <= buf->size) { memory_region_set_dirty(&buf->mr, start, size); |