diff options
| author | Filippo Tarpini <filippotarpini@hotmail.it> | 2021-01-16 23:10:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-16 23:10:35 +0200 |
| commit | 43223aadc829b7546bc2e28b6ee6544a2ae2f9aa (patch) | |
| tree | b985a672efc906f208ff76176c749d13ece1462e /Source/Core | |
| parent | be74e35a0a141b96711e8e6259aaeaea752718c0 (diff) | |
Qt: Fix Shake Mapping Indicator not showing deadzone
QRectF was missing from drawRect which meant the deazone was casted to an int, flooring its value (it goes from 0 to 1).
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp index b44c8c803e..e337226b2f 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp @@ -592,9 +592,13 @@ void ShakeMappingIndicator::Draw() p.scale(1.0, -1.0); // Deadzone. - p.setPen(GetDeadZonePen()); - p.setBrush(GetDeadZoneBrush(p)); - p.drawRect(-1.0, 0, 2, m_shake_group.GetDeadzone()); + const double deadzone = m_shake_group.GetDeadzone(); + if (deadzone > 0.0) + { + p.setPen(GetDeadZonePen()); + p.setBrush(GetDeadZoneBrush(p)); + p.drawRect(QRectF(-1, 0, 2, deadzone)); + } // Raw input. const auto raw_coord = m_shake_group.GetState(false); |
