aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-04 20:21:32 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-04 20:21:32 +0000
commitc11d066d6bb945d5b16c70d1f2450474da35f85f (patch)
tree5b65078aa5dbf44e202adf4ef3233376f0a637b7
parent5ccb2e23039aa914d864bde51136b3ccf1a808be (diff)
split more
-rw-r--r--spectrogram.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/spectrogram.c b/spectrogram.c
index d5b3408..64b8d3b 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -157,6 +157,13 @@ blit(Display *d, Drawable p, GC gc, XRectangle r)
}
void
+clear(Display *d, Drawable p, GC gc, XRectangle r)
+{
+ XSetForeground(d, gc, BlackPixel(d, DefaultScreen(d)));
+ XFillRectangle(d, p, gc, 0, 0, r.width, r.height);
+}
+
+void
draw_panel(Display *d, struct panel *p)
{
int i, v, x;
@@ -168,14 +175,9 @@ draw_panel(Display *d, struct panel *p)
/* clear spectrogram */
- XSetForeground(d, p->sp->gc, p->palette[0]);
- XFillRectangle(d, p->sp->pix, p->sp->gc,
- 0, 0, p->sp->geo.width, p->sp->geo.height);
-
+ clear(d, p->sp->pix, p->sp->gc, p->sp->geo);
/* clear mask */
- XSetForeground(d, p->bg->gc, 0);
- XFillRectangle(d, p->bg->mask, p->bg->gc,
- 0, 0, p->bg->geo.width, p->bg->geo.height);
+ clear(d, p->bg->mask, p->bg->gc, p->bg->geo);
for (i = 0; i < p->sp->geo.width; i++) {
/* limit maxval */