MemorySwapMeter: use full width on odd total width

This commit is contained in:
Christian Göttsche 2021-08-21 20:21:21 +02:00
parent a905c45195
commit cf45a5d02b
1 changed files with 2 additions and 4 deletions

View File

@ -33,12 +33,10 @@ static void MemorySwapMeter_updateValues(Meter* this) {
static void MemorySwapMeter_draw(Meter* this, int x, int y, int w) { static void MemorySwapMeter_draw(Meter* this, int x, int y, int w) {
MemorySwapMeterData* data = this->meterData; MemorySwapMeterData* data = this->meterData;
int colwidth = (w - 2) / 2 + 1;
assert(data->memoryMeter->draw); assert(data->memoryMeter->draw);
data->memoryMeter->draw(data->memoryMeter, x, y, colwidth); data->memoryMeter->draw(data->memoryMeter, x, y, w / 2);
assert(data->swapMeter->draw); assert(data->swapMeter->draw);
data->swapMeter->draw(data->swapMeter, x + w / 2, y, colwidth); data->swapMeter->draw(data->swapMeter, x + w / 2, y, w - w / 2);
} }
static void MemorySwapMeter_init(Meter* this) { static void MemorySwapMeter_init(Meter* this) {