aboutsummaryrefslogtreecommitdiff
path: root/Sgraph.c
diff options
context:
space:
mode:
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 357e021..cbcabf3 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -186,7 +186,7 @@ static void
Redisplay(Widget w, XEvent *event, Region r)
{
SgraphWidget sw = (SgraphWidget)w;
- Dimension i, x, y;
+ Dimension i, x, y, width;
XdbeSwapInfo swap;
if (!XtIsRealized(w))
@@ -196,7 +196,11 @@ Redisplay(Widget w, XEvent *event, Region r)
Trace(w);
#endif
- for (i = 0; i < sw->core.width - 1; i++) {
+ width = sw->core.width;
+ if (width > sw->sgraph.size)
+ width = sw->sgraph.size;
+
+ for (i = 0; i < width - 1; i++) {
y = sw->sgraph.values[i];
x = sw->sgraph.mirror ? sw->core.width - i : i;