aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-03 19:38:11 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-03 19:38:11 +0000
commit9467621e730509a2b5d1822857ee2d7474a208aa (patch)
tree289b01bffe621c78ab88419e8530056449a1d06d
parent65ad11c68448871ae213f53cf39ad696aeaae5ed (diff)
simpilfy
-rw-r--r--spectrogram.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/spectrogram.c b/spectrogram.c
index 27d16e5..b903373 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -148,13 +148,13 @@ usage(void)
void
init_bg(Display *d, Pixmap pix, GC gc, XRectangle r, unsigned long *pal)
{
- int i;
+ int i, x, y;
+ x = r.width - 1;
for (i = 0; i < r.height; i++) {
+ y = r.height - i - 1;
XSetForeground(d, gc, pal[i]);
- XDrawLine(d, pix, gc,
- 0, r.height - i - 1,
- r.width - 1, r.height - i - 1);
+ XDrawLine(d, pix, gc, 0, y, x, y);
}
}