From 79e00d3c902f08f6385ef67840179fabf169e674 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 4 Dec 2015 21:10:27 -0500 Subject: [PATCH] Fixed improper initialization of uiDrawStrokeParams in the histogram example. --- examples/histogram/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/histogram/main.c b/examples/histogram/main.c index bae0bdae..9c93d178 100644 --- a/examples/histogram/main.c +++ b/examples/histogram/main.c @@ -106,6 +106,10 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p) // figure out dimensions graphSize(p->ClientWidth, p->ClientHeight, &graphWidth, &graphHeight); + // clear sp to avoid passing garbage to uiDrawStroke() + // for example, we don't use dashing + memset(&sp, 0, sizeof (uiDrawStrokeParams)); + // make a stroke for both the axes and the histogram line sp.Cap = uiDrawLineCapFlat; sp.Join = uiDrawLineJoinMiter;