[apps] Graph: avoid reloading when highlighting the area under curve

(which does change in the Graph app)
This commit is contained in:
Émilie Feral
2018-01-10 17:24:28 +01:00
committed by EmilieNumworks
parent a0704898b1
commit 7cd05e520a
3 changed files with 8 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
#include "graph_view.h"
#include <float.h>
using namespace Shared;

View File

@@ -14,6 +14,11 @@ public:
void reload() override;
void drawRect(KDContext * ctx, KDRect rect) const override;
void drawTangent(bool tangent) { m_tangent = tangent; }
/* We override setAreaHighlightColor to make it reload nothing as the
* highlightColor and the non-highlightColor are identical in the graph view
* of the application graph. We thereby avoid to uselessly reload some part
* of the graph where the area under the curve is colored. */
void setAreaHighlightColor(bool highlightColor) override {};
private:
CartesianFunctionStore * m_functionStore;
bool m_tangent;

View File

@@ -19,8 +19,9 @@ public:
void selectFunction(Function * function);
void setVerticalCursor(bool verticalCursor);
void setAreaHighlight(float start, float end);
void setAreaHighlightColor(bool highlightColor);
virtual void setAreaHighlightColor(bool highlightColor);
protected:
void reloadBetweenBounds(float start, float end);
Function * m_selectedFunction;
bool m_verticalCursor;
float m_highlightedStart;
@@ -28,7 +29,6 @@ protected:
bool m_shouldColorHighlighted;
private:
KDSize cursorSize() override;
void reloadBetweenBounds(float start, float end);
char * label(Axis axis, int index) const override;
char m_xLabels[k_maxNumberOfXLabels][Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
char m_yLabels[k_maxNumberOfYLabels][Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];