From 1d95aaae57f555f8b6930cf223316fb2ab6fc430 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 18 Sep 2014 16:33:35 +0000 Subject: basic data display --- Sgraph.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Sgraph.c') diff --git a/Sgraph.c b/Sgraph.c index a8e1e3f..3251384 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -250,22 +250,30 @@ Redisplay(Widget w, XEvent *event, Region r) 0, 0, width, height); */ + /* XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, 0, height / 2, 2 * width, height / 2); XDrawLine(XtDisplay(sw), sw->sgraph.backBuf, sw->sgraph.foreGC, 0, height / 2 + height, 2 * width, height / 2 + height); + */ for (x = 0; x < sw->sgraph.size; x++) { - yl = sw->sgraph.leftData[x] * height / 2; + 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; - XDrawPoint(XtDisplay(sw), sw->sgraph.backBuf, - sw->sgraph.foreGC, x, yl); + 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); + */ } /* flicker test */ -- cgit v1.2.3