Skip to content

Commit

Permalink
Drawing.h:
Browse files Browse the repository at this point in the history
* Better use roundI() instead of static casts when rendering lines. Unnoticeable difference though AFAICS.
  • Loading branch information
razterizer committed Oct 3, 2024
1 parent fb95f2b commit 371629c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Drawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace bresenham

for (auto c : math::linspace(c0, 1.f, c1))
{
sh.write_buffer(str, static_cast<int>(r), static_cast<int>(c), fg_color, bg_color);
sh.write_buffer(str, math::roundI(r), math::roundI(c), fg_color, bg_color);
if (D > 0)
{
r += ri;
Expand Down Expand Up @@ -52,7 +52,7 @@ namespace bresenham

for (auto r : math::linspace(r0, 1.f, r1))
{
sh.write_buffer(str, static_cast<int>(r), static_cast<int>(c), fg_color, bg_color);
sh.write_buffer(str, math::roundI(r), math::roundI(c), fg_color, bg_color);
if (D > 0)
{
c += ci;
Expand Down

0 comments on commit 371629c

Please sign in to comment.