Separate data-update and drawing of header

This commit is contained in:
Christian Göttsche
2021-02-08 16:38:49 +01:00
committed by BenBE
parent 2d1042adb3
commit b862e36ee7
7 changed files with 38 additions and 8 deletions

View File

@ -177,6 +177,17 @@ void Header_draw(const Header* this) {
}
}
void Header_updateData(Header* this) {
Header_forEachColumn(this, col) {
Vector* meters = this->columns[col];
int items = Vector_size(meters);
for (int i = 0; i < items; i++) {
Meter* meter = (Meter*) Vector_get(meters, i);
Meter_updateValues(meter);
}
}
}
/*
* Calculate how many columns the current meter is allowed to span,
* by counting how many columns to the right are empty or contain a BlankMeter.