diff --git a/noise/basis/type/distance.cpp b/noise/basis/type/distance.cpp index deb1252f..35ee2661 100644 --- a/noise/basis/type/distance.cpp +++ b/noise/basis/type/distance.cpp @@ -1,15 +1,21 @@ #include "./distance.hpp" #include "../../../extent.hpp" +#include "../../../types/casts.hpp" /////////////////////////////////////////////////////////////////////////////// template -static const std::array, util::pow(R*2+1,S)> +static const std::array< + util::vectori, + util::pow(R*2+1,S) +> generate (void) { + using value_type = typename util::vectori::value_type; + static const util::extent_range< S,typename util::vectori::value_type - > area (util::extent::value_type> {R*2+1}); + > area (util::extent {R*2+1}); std::array< util::vectori, @@ -18,7 +24,9 @@ generate (void) std::transform (area.begin (), area.end (), out.begin (), - [] (auto i) { return i.template as () - R; }); + [] (auto i) { + return i.template as () - sign_cast (R); + }); return out; } diff --git a/region.cpp b/region.cpp index 7c7cddd9..e01dd215 100644 --- a/region.cpp +++ b/region.cpp @@ -264,7 +264,7 @@ util::region::inset (T mag) return { p + mag, - e - 2 * mag + e - static_cast (2 * mag) }; }