From cfb9eece7abd8428859ea5842aff4a9d5777a00c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 18 Sep 2014 17:22:49 +0000 Subject: buggy, but right direction --- Sgraph.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'Sgraph.c') diff --git a/Sgraph.c b/Sgraph.c index 17d1b7d..4779d6d 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -251,30 +251,20 @@ Redisplay(Widget w, XEvent *event, Region r) 0, 0, width, height); */ - for (x = 0; x < sw->sgraph.size; x++) { - if (x > width) - yl = sw->sgraph.leftData[x] * height / 2; - else - yl = sw->sgraph.leftData[x]; - yl += height / 2; - - yr = sw->sgraph.rightData[x] * height / 2; - yr += height / 2; - yr += height; + for (x = 0; x < sw->sgraph.size / 2; x++) { + yl = sw->sgraph.leftData[x]; + yr = sw->sgraph.rightData[x]; XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, - x, height / 2, x, yl); - /* - XDrawPoint(XtDisplay(sw), sw->sgraph.backBuf, - sw->sgraph.foreGC, x, yr); - */ + width - x, height, + width - x, height - yl); + XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, + sw->sgraph.foreGC, + width + x, height, + width + x, height - yr); } - /* flicker test */ - XFillRectangle(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, - width / 2, 2 * height, width, 3 * height); - swap.swap_window = XtWindow(sw); swap.swap_action = XdbeBackground; -- cgit v1.2.3