Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
977b2498
Commit
977b2498
authored
Aug 24, 2019
by
Stefan Haun
Browse files
gfx: Fix line drawing algorithm
Lines have been one pixel too short.
parent
4f101232
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gfx/gfx.c
View file @
977b2498
...
...
@@ -198,7 +198,7 @@ static void plot_line_low(
int
d
=
2
*
dy
-
dx
;
int
y
=
y0
;
for
(
int
x
=
x0
;
x
<
x1
;
x
++
)
{
for
(
int
x
=
x0
;
x
<
=
x1
;
x
++
)
{
if
(
t
>
1
)
{
gfx_circle_fill
(
reg
,
x
,
y
,
t
,
c
);
}
else
{
...
...
@@ -231,7 +231,7 @@ static void plot_line_high(
int
d
=
2
*
dx
-
dy
;
int
x
=
x0
;
for
(
int
y
=
y0
;
y
<
y1
;
y
++
)
{
for
(
int
y
=
y0
;
y
<
=
y1
;
y
++
)
{
if
(
t
>
1
)
{
gfx_circle_fill
(
reg
,
x
,
y
,
t
,
c
);
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment