diff options
author | Nikita Yushchenko <nikita.yoush@cogentembedded.com> | 2017-10-12 20:52:26 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-10-16 09:12:44 +0200 |
commit | 8973abf57a5302d1dd7c62331d9c20c233fb6638 (patch) | |
tree | 0231bf57f01e1e412db2990cb54c4d3e5424ad8f /lib | |
parent | b258642b7db16b6a2a47f958357db597251304c9 (diff) | |
download | barebox-8973abf57a5302d1dd7c62331d9c20c233fb6638.tar.gz barebox-8973abf57a5302d1dd7c62331d9c20c233fb6638.tar.xz |
2d-primitives: fix missing pixel in gu_draw_line()
When drawing line from (x1, y1) to (x2, y2), pixel at (x2, y2) should
be included.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Tested-by: Chris Healy <[1]cphealy@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gui/2d-primitives.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gui/2d-primitives.c b/lib/gui/2d-primitives.c index 0f29b32bab..89acc092d5 100644 --- a/lib/gui/2d-primitives.c +++ b/lib/gui/2d-primitives.c @@ -61,7 +61,7 @@ static void draw_simple_line(struct screen *sc, swap(y1, y2); } - for (x = x1; x < x2 - 1; x++) { + for (x = x1; x <= x2; x++) { if (!dash || (++pixel % (2 * dash)) < dash) illuminate(sc->info, @@ -137,7 +137,7 @@ void gu_draw_line(struct screen *sc, j = y1; eps = dy - dx; - for (i = x1; i <= x2 - 1; i++) { + for (i = x1; i <= x2; i++) { if (!dash || (++pixel % (2 * dash)) > dash) { illuminate(sc->info, |