RMG-Input: fix accuracy of stick movement in ControllerImageWidget.cpp

This commit is contained in:
Rosalie Wanders
2025-03-19 22:00:24 +01:00
parent ac7b9bce27
commit 0d2b88037f
@@ -173,8 +173,8 @@ void ControllerImageWidget::paintEvent(QPaintEvent *event)
const double sensitivityFactor = this->sensitivityValue / 100.0;
const double sensitivityAdjustedMaxOffset = absoluteMaxOffset * std::min(sensitivityFactor, 1.0);
double offsetDeadzone = this->deadzoneValue * sensitivityFactor * offsetSlope;
int offsetx = this->xAxisState * sensitivityFactor * offsetSlope;
int offsety = this->yAxisState * sensitivityFactor * offsetSlope;
double offsetx = this->xAxisState * sensitivityFactor * offsetSlope;
double offsety = this->yAxisState * sensitivityFactor * offsetSlope;
const double offsetDist = std::hypot(offsetx, offsety);
// take deadzone into account