From 60c1097c987fb516474cdae9f1f9d2bab6c3c6f1 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 18 Sep 2014 15:49:38 +0000 Subject: add normalization --- Sgraph.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Sgraph.c') diff --git a/Sgraph.c b/Sgraph.c index b06544f..e18a2de 100644 --- a/Sgraph.c +++ b/Sgraph.c @@ -249,9 +249,13 @@ Redisplay(Widget w, XEvent *event, Region r) 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] / (2 * height) + height / 2; - yr = sw->sgraph.rightData[x] / (2 * height) + height / 2; + yl = sw->sgraph.leftData[x] * height / 2; + 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); XDrawPoint(XtDisplay(sw), sw->sgraph.backBuf, -- cgit v1.2.3