This commit is contained in:
scribam 2018-04-29 08:41:51 +02:00 committed by Ivan
parent fc23243d01
commit 04ad49de4d
48 changed files with 117 additions and 118 deletions

View file

@ -242,7 +242,7 @@ std::tuple<u16, u16> PadHandlerBase::ConvertToSquirclePoint(u16 inX, u16 inY, in
// https://thatsmaths.com/2016/07/14/squircles/
const f32 newLen = (1 + std::pow(std::sin(2 * angle), 2.f) / (float(squircle_factor) / 1000.f)) * r;
// we now have len and angle, convert to cartisian
// we now have len and angle, convert to cartesian
const int newX = Clamp0To255(((newLen * std::cos(angle)) + 1) * 127.5f);
const int newY = Clamp0To255(((newLen * std::sin(angle)) + 1) * 127.5f);
return std::tuple<u16, u16>(newX, newY);