summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
diff options
context:
space:
mode:
authorArtemis Tosini <me@artem.ist>2019-05-18 18:36:28 +0000
committerArtemis Tosini <me@artem.ist>2019-05-18 18:36:28 +0000
commit99cf9a57fc931ced60e95a391c46a64cf4578988 (patch)
treebc9fc0ccc98c1eee7ccd476e0b097d4e918aa491 /Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
parent49e46c8aff1db605c5456997d5d94ac40d6e7869 (diff)
Draw center when calibrating and remove constant
This adds the center to the calibration menu when it is nonzero. It also refactors CENTER_COLOR to be a function, similar to other colors after an earlier commit.
Diffstat (limited to 'Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp')
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
index f1cf24b68d..ef807b9d8f 100644
--- a/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
@@ -29,7 +29,6 @@
namespace
{
-const QColor CENTER_COLOR = Qt::blue;
const QColor C_STICK_GATE_COLOR = Qt::yellow;
const QColor CURSOR_TV_COLOR = 0xaed6f1;
const QColor TILT_GATE_COLOR = 0xa2d9ce;
@@ -65,6 +64,11 @@ QColor MappingIndicator::GetAdjustedInputColor() const
return Qt::red;
}
+QColor MappingIndicator::GetCenterColor() const
+{
+ return Qt::blue;
+}
+
QColor MappingIndicator::GetDeadZoneColor() const
{
return palette().shadow().color();
@@ -265,7 +269,7 @@ void MappingIndicator::DrawCursor(ControllerEmu::Cursor& cursor)
if (center.x || center.y)
{
p.setPen(Qt::NoPen);
- p.setBrush(CENTER_COLOR);
+ p.setBrush(GetCenterColor());
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
}
@@ -363,7 +367,7 @@ void MappingIndicator::DrawReshapableInput(ControllerEmu::ReshapableInput& stick
if (center.x || center.y)
{
p.setPen(Qt::NoPen);
- p.setBrush(CENTER_COLOR);
+ p.setBrush(GetCenterColor());
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
}
@@ -566,7 +570,7 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force)
if (center.x || center.y)
{
p.setPen(Qt::NoPen);
- p.setBrush(CENTER_COLOR);
+ p.setBrush(GetCenterColor());
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
}
@@ -711,6 +715,14 @@ void MappingIndicator::DrawCalibration(QPainter& p, Common::DVec2 point, Common:
[this](double angle) { return m_calibration_widget->GetCalibrationRadiusAtAngle(angle); },
scale, center));
+ // Center.
+ if (center.x || center.y)
+ {
+ p.setPen(Qt::NoPen);
+ p.setBrush(GetCenterColor());
+ p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
+ }
+
// Stick position.
p.setPen(Qt::NoPen);
p.setBrush(GetAdjustedInputColor());