From 19921ec1258b487b992b0e833d3925bb67fcd575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 3 Oct 2019 17:01:24 +0200 Subject: [PATCH] [apps/regression/graph] Fix roundCursorView drawing glitch Scenario: f(x)=cos(x) CalculateZeroes -> drawing glitch Right, Back -> drawing glitch --- apps/graph/graph/graph_controller.cpp | 3 +++ apps/regression/graph_controller.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/graph/graph/graph_controller.cpp b/apps/graph/graph/graph_controller.cpp index 00d12abf6..6a712cf47 100644 --- a/apps/graph/graph/graph_controller.cpp +++ b/apps/graph/graph/graph_controller.cpp @@ -31,6 +31,9 @@ I18n::Message GraphController::emptyMessage() { void GraphController::viewWillAppear() { m_view.drawTangent(false); +#ifdef GRAPH_CURSOR_SPEEDUP + m_cursorView.resetMemoization(); +#endif m_view.setCursorView(&m_cursorView); FunctionGraphController::viewWillAppear(); selectFunctionWithCursor(indexFunctionSelectedByCursor()); diff --git a/apps/regression/graph_controller.cpp b/apps/regression/graph_controller.cpp index ffee0eed2..a78abf7e9 100644 --- a/apps/regression/graph_controller.cpp +++ b/apps/regression/graph_controller.cpp @@ -45,6 +45,9 @@ I18n::Message GraphController::emptyMessage() { } void GraphController::viewWillAppear() { +#ifdef GRAPH_CURSOR_SPEEDUP + m_roundCursorView.resetMemoization(); +#endif /* At this point, some series might have been removed from the model. We need * to reinitialize the selected series index if the current selection is * either null (right after construction) or refering a removed series. */