]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/display/artist: Fix invalidation of lines in artist_draw_line()
authorSven Schnelle <svens@stackframe.org>
Sat, 8 Aug 2020 19:56:29 +0000 (21:56 +0200)
committerHelge Deller <deller@gmx.de>
Wed, 26 Aug 2020 21:04:00 +0000 (23:04 +0200)
The old code didn't invalidate correctly when vertical lines were drawn.
Fix this and move the invalidation out of the loop.

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

index 44bb67bbc37731e6c430973662a96a1c8812e1e5..a959b2c1583abeba98f54b88e7aac8f527410510 100644 (file)
@@ -662,7 +662,6 @@ static void draw_line(ARTISTState *s,
         }
 
         if (e > 0) {
-            artist_invalidate_lines(buf, y, 1);
             y  += incy;
             e  += diago;
         } else {
@@ -670,6 +669,10 @@ 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);
+    else
+        artist_invalidate_lines(buf, y, dx+1);
 }
 
 static void draw_line_pattern_start(ARTISTState *s)