Skip to content

Commit

Permalink
Reorder GraphMeterMode_draw() code slightly
Browse files Browse the repository at this point in the history
to make it look more logical when reading. No changes in behavior.
  • Loading branch information
Explorer09 authored and BenBE committed Jul 23, 2024
1 parent d888b99 commit 25391b2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,6 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
if (w <= 0)
return;

if ((size_t)w > nValues / 2) {
x += w - nValues / 2;
w = nValues / 2;
}

const char* const* GraphMeterMode_dots;
int GraphMeterMode_pixPerRow;
#ifdef HAVE_LIBNCURSESW
Expand All @@ -244,7 +239,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
GraphMeterMode_pixPerRow = PIXPERROW_ASCII;
}

if ((size_t)w > nValues / 2) {
x += w - nValues / 2;
w = nValues / 2;
}
size_t i = nValues - (size_t)w * 2;

for (int col = 0; i < nValues - 1; i += 2, col++) {
int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT;
double total = MAXIMUM(this->total, 1);
Expand Down

0 comments on commit 25391b2

Please sign in to comment.