mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibGFX: Draw the ends of lines with non-standard thickness
Lines are drawn using squares the size of the thickness, so if the length of the line was not a multiple of the thickness, the end of the line was not drawn correctly.
This commit is contained in:
parent
cd7473d1a3
commit
aa180c821d
Notes:
sideshowbarker
2024-07-18 03:12:08 +09:00
Author: https://github.com/GalHorowitz Commit: https://github.com/SerenityOS/serenity/commit/aa180c821d3 Pull-request: https://github.com/SerenityOS/serenity/pull/10313
1 changed files with 2 additions and 0 deletions
|
@ -1739,6 +1739,7 @@ void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color,
|
|||
} else {
|
||||
for (int y = min_y; y <= max_y; y += thickness)
|
||||
draw_physical_pixel({ x, y }, color, thickness);
|
||||
draw_physical_pixel({ x, max_y }, color, thickness);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1773,6 +1774,7 @@ void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color,
|
|||
} else {
|
||||
for (int x = min_x; x <= max_x; x += thickness)
|
||||
draw_physical_pixel({ x, y }, color, thickness);
|
||||
draw_physical_pixel({ max_x, y }, color, thickness);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue