aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-18 17:22:49 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-18 17:22:49 +0000
commitcfb9eece7abd8428859ea5842aff4a9d5777a00c (patch)
tree6e01df0739989c4e957f0d83cfb783336901e412
parent1179eff95346a0bbf93b4f19c17e2f7eec68ce91 (diff)
buggy, but right direction
-rw-r--r--Sgraph.c28
1 files changed, 9 insertions, 19 deletions
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;