]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/display/artist: Fix draw_line() artefacts
authorSven Schnelle <svens@stackframe.org>
Sun, 23 Jan 2022 15:47:47 +0000 (16:47 +0100)
committerHelge Deller <deller@gmx.de>
Wed, 2 Feb 2022 17:46:45 +0000 (18:46 +0100)
The draw_line() function left artefacts on the screen because it was using the
x/y variables which were incremented in the loop before. Fix it by using the
unmodified x1/x2 variables instead.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Helge Deller <deller@gmx.de>
hw/display/artist.c

index 8a9fa482d04d4aedcaf1ff0f5612385324a748a0..1d877998b9ae28897604407efaf6a3f152c86556 100644 (file)
@@ -553,10 +553,11 @@ static void draw_line(ARTISTState *s,
         }
         x++;
     } while (x <= x2 && (max_pix == -1 || --max_pix > 0));
+
     if (c1)
-        artist_invalidate_lines(buf, x, dy+1);
+        artist_invalidate_lines(buf, x1, x2 - x1);
     else
-        artist_invalidate_lines(buf, y, dx+1);
+        artist_invalidate_lines(buf, y1 > y2 ? y2 : y1, x2 - x1);
 }
 
 static void draw_line_pattern_start(ARTISTState *s)