From 7b00072ccf5fcca70f044f160236c58efeebca67 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Tue, 25 Feb 2020 10:29:13 +0100 Subject: [PATCH] [apps/regression/graph_controller] Factor m_roundCursorView.setColor in setRoundCrossCursorView --- apps/regression/graph_controller.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/regression/graph_controller.cpp b/apps/regression/graph_controller.cpp index 78f8ea350..3e23236ca 100644 --- a/apps/regression/graph_controller.cpp +++ b/apps/regression/graph_controller.cpp @@ -88,14 +88,12 @@ void GraphController::viewWillAppear() { setRoundCrossCursorView(false); } else { setRoundCrossCursorView(true); - m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]); } } void GraphController::selectRegressionCurve() { *m_selectedDotIndex = -1; setRoundCrossCursorView(true); - m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]); } // Private @@ -405,7 +403,12 @@ InteractiveCurveViewRangeDelegate::Range GraphController::computeYRange(Interact } void GraphController::setRoundCrossCursorView(bool round) { + if (round) { + // Set the color although the cursor view stays round + m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]); + } CursorView * nextCursorView = round ? static_cast(&m_roundCursorView) : static_cast(&m_crossCursorView); + // Escape if the cursor view stays the same if (m_view.cursorView() == nextCursorView) { return; }