mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
InputCommon: Clamp calibration values within square shape.
This commit is contained in:
parent
f8cca9fe5d
commit
bd43e084f4
1 changed files with 2 additions and 1 deletions
|
@ -183,7 +183,8 @@ void ReshapableInput::UpdateCalibrationData(CalibrationData& data, Common::DVec2
|
||||||
auto& calibration_sample = data[calibration_index];
|
auto& calibration_sample = data[calibration_index];
|
||||||
|
|
||||||
// Update closest sample from provided x,y.
|
// Update closest sample from provided x,y.
|
||||||
calibration_sample = std::max(calibration_sample, point.Length());
|
calibration_sample = std::clamp(point.Length(), calibration_sample,
|
||||||
|
SquareStickGate(1).GetRadiusAtAngle(calibration_angle));
|
||||||
|
|
||||||
// Here we update all other samples in our calibration vector to maintain
|
// Here we update all other samples in our calibration vector to maintain
|
||||||
// a convex polygon containing our new calibration point.
|
// a convex polygon containing our new calibration point.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue