Skip to content
Snippets Groups Projects
Commit fd44f7ff authored by Julian Schakib's avatar Julian Schakib
Browse files

calculating first line parameter and clamping value.

parent 31e3586a
Branches
Tags
1 merge request!55contains, rasterize, fast_rasterize
......@@ -43,12 +43,15 @@ constexpr void rasterize(segment<2, ScalarT> const& l, F&& f, bool experimental
signed char const iy((delta_y > 0) - (delta_y < 0));
delta_y = std::abs(delta_y) << 1;
// start
f(tg::ipos2(x0, y0), 0);
auto a = ScalarT(0);
auto aStep = ScalarT(0);
// start
// if (!experimental)
a = tg::length(tg::pos2(x0, y0) - l.pos0) / tg::length(l.pos1 - l.pos0);
f(tg::ipos2(x0, y0), a);
if (delta_x >= delta_y)
{
// done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment