mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-04 02:45:12 +00:00
Round squircled axis values to nearest whole number
This commit is contained in:
parent
44b3709d1d
commit
6a9e0c52c3
@ -255,8 +255,8 @@ std::tuple<u16, u16> PadHandlerBase::ConvertToSquirclePoint(u16 inX, u16 inY, in
|
||||
const f32 newLen = (1 + std::pow(std::sin(2 * angle), 2.f) / (squircle_factor / 1000.f)) * r;
|
||||
|
||||
// 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);
|
||||
const int newX = Clamp0To255(std::round(((newLen * std::cos(angle)) + 1) * 127.5f));
|
||||
const int newY = Clamp0To255(std::round(((newLen * std::sin(angle)) + 1) * 127.5f));
|
||||
return std::tuple<u16, u16>(newX, newY);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user