mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-21 17:09:14 +01:00
Fixed NaN problem when cap is 0
This commit is contained in:
parent
c007c43736
commit
31aa0a1aac
@ -1082,8 +1082,8 @@ namespace DS4Windows
|
||||
double absSideX = Math.Abs(sideX); double absSideY = Math.Abs(sideY);
|
||||
if (absSideX > capX) capX = absSideX;
|
||||
if (absSideY > capY) capY = absSideY;
|
||||
double tempRatioX = (dState.RX - 128.0) / capX;
|
||||
double tempRatioY = (dState.RY - 128.0) / capY;
|
||||
double tempRatioX = capX > 0 ? (dState.RX - 128.0) / capX : 0;
|
||||
double tempRatioY = capY > 0 ? (dState.RY - 128.0) / capY : 0;
|
||||
double signX = tempRatioX >= 0.0 ? 1.0 : -1.0;
|
||||
double signY = tempRatioY >= 0.0 ? 1.0 : -1.0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user