mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/regression/graph_controller] Update model before setting cursor view
This commit is contained in:
committed by
LeaNumworks
parent
4f279f15da
commit
b8b6e4b5b8
@@ -313,6 +313,8 @@ bool GraphController::moveCursorVertically(int direction) {
|
||||
|
||||
assert(!validDot || !validRegression);
|
||||
|
||||
/* The model should be up to date before setting the cursor view. */
|
||||
|
||||
if (validRegression) {
|
||||
// Select the regression
|
||||
*m_selectedSeriesIndex = closestRegressionSeries;
|
||||
@@ -324,9 +326,9 @@ bool GraphController::moveCursorVertically(int direction) {
|
||||
|
||||
if (validDot) {
|
||||
// Select the dot
|
||||
setRoundCrossCursorView(false);
|
||||
*m_selectedSeriesIndex = closestDotSeries;
|
||||
*m_selectedDotIndex = dotSelected;
|
||||
setRoundCrossCursorView(false);
|
||||
if (dotSelected == m_store->numberOfPairsOfSeries(*m_selectedSeriesIndex)) {
|
||||
// Select the mean dot
|
||||
double x = m_store->meanOfColumn(*m_selectedSeriesIndex, 0);
|
||||
@@ -395,6 +397,8 @@ InteractiveCurveViewRangeDelegate::Range GraphController::computeYRange(Interact
|
||||
}
|
||||
|
||||
void GraphController::setRoundCrossCursorView(bool round) {
|
||||
/* At this point, the model (selected series and dot indices) should be up
|
||||
* to date. */
|
||||
if (round) {
|
||||
// Set the color although the cursor view stays round
|
||||
m_roundCursorView.setColor(Palette::DataColor[*m_selectedSeriesIndex]);
|
||||
|
||||
Reference in New Issue
Block a user