diff --git a/apps/graph/graph/graph_view.cpp b/apps/graph/graph/graph_view.cpp index d8c9dd61b..c688d282b 100644 --- a/apps/graph/graph/graph_view.cpp +++ b/apps/graph/graph/graph_view.cpp @@ -162,13 +162,15 @@ void GraphView::drawFunction(KDContext * ctx, KDRect rect) const { for (KDCoordinate px = rect.x()-stampSize; pxnumberOfFunctions(); i++) { - Float xExp = Float(x); - plotContext.setExpressionForSymbolName(&xExp, "x"); Graph::Function * f = m_functionStore->functionAtIndex(i); - float y = f->expression()->approximate(plotContext); - KDCoordinate py = floatToPixel(Axis::Vertical, y); - KDRect stampRect(px, py, stampSize, stampSize); - ctx->fillRectWithMask(stampRect, f->color(), mask, workingBuffer); + if (f->isActive()) { + Float xExp = Float(x); + plotContext.setExpressionForSymbolName(&xExp, "x"); + float y = f->expression()->approximate(plotContext); + KDCoordinate py = floatToPixel(Axis::Vertical, y); + KDRect stampRect(px, py, stampSize, stampSize); + ctx->fillRectWithMask(stampRect, f->color(), mask, workingBuffer); + } } } } diff --git a/apps/graph/list/function_cell.cpp b/apps/graph/list/function_cell.cpp index 5d452b8f7..8777b1152 100644 --- a/apps/graph/list/function_cell.cpp +++ b/apps/graph/list/function_cell.cpp @@ -31,3 +31,8 @@ void FunctionCell::setHighlighted(bool highlight) { Graph::Function * FunctionCell::function() { return m_function; } + +void FunctionCell::reloadCell() { + //TODO: optimize for function_name_view (make it virtual) + markRectAsDirty(bounds()); +} diff --git a/apps/graph/list/function_cell.h b/apps/graph/list/function_cell.h index 579a581ee..a234ce88f 100644 --- a/apps/graph/list/function_cell.h +++ b/apps/graph/list/function_cell.h @@ -11,6 +11,7 @@ public: void setEven(bool even); void setHighlighted(bool highlight); Graph::Function * function(); + void reloadCell(); static constexpr KDColor k_evenLineBackgroundColor = KDColor(0xF9F9F9); static constexpr KDColor k_oddLineBackgroundColor = KDColor(0xEEEEF2); diff --git a/apps/graph/list/function_expression_view.h b/apps/graph/list/function_expression_view.h index 4fd549736..173773bd2 100644 --- a/apps/graph/list/function_expression_view.h +++ b/apps/graph/list/function_expression_view.h @@ -9,7 +9,6 @@ class FunctionCell; class FunctionExpressionView : public FunctionCell { public: FunctionExpressionView(); - void drawRect(KDContext * ctx, KDRect rect) const override; };