[apps/graph] Memoize baselines in functions list

This commit is contained in:
Léa Saviot
2018-11-29 14:58:41 +01:00
parent 9b9a0aa009
commit 569e0e884e
8 changed files with 110 additions and 29 deletions

View File

@@ -3,12 +3,6 @@
namespace Shared {
FunctionTitleCell::FunctionTitleCell(Orientation orientation) :
EvenOddCell(),
m_orientation(orientation)
{
}
void FunctionTitleCell::setOrientation(Orientation orientation) {
m_orientation = orientation;
reloadCell();
@@ -19,6 +13,13 @@ void FunctionTitleCell::setColor(KDColor color) {
reloadCell();
}
void FunctionTitleCell::setBaseline(KDCoordinate baseline) {
if (m_baseline != baseline) {
m_baseline = baseline;
reloadCell();
}
}
void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
if (m_orientation == Orientation::VerticalIndicator){
ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor);