aboutsummaryrefslogtreecommitdiff
path: root/Sgraph.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-18 15:49:38 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-18 15:49:38 +0000
commit60c1097c987fb516474cdae9f1f9d2bab6c3c6f1 (patch)
tree409dc11eece73424e840d12d8ff0dec72a20da6d /Sgraph.c
parentf0a7687ebd6eab275c3e1f0b3f753b556c74246b (diff)
add normalization
Diffstat (limited to 'Sgraph.c')
-rw-r--r--Sgraph.c8
1 files changed, 6 insertions, 2 deletions
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,