diff mbox series

[v4,11/12] hw/display/artist: Fix invalidation of lines in artist_draw_line()

Message ID 20200809052402.31641-12-deller@gmx.de
State New
Headers show
Series None | expand

Commit Message

Helge Deller Aug. 9, 2020, 5:24 a.m. UTC
From: Sven Schnelle <svens@stackframe.org>

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--
2.21.3
diff mbox series

Patch

diff --git a/hw/display/artist.c b/hw/display/artist.c
index e7452623f9..09d8b541f5 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -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)