From: Miroslav Lichvar Date: Wed, 20 Mar 2013 16:37:07 +0000 (+0100) Subject: don't draw scale when not mapped X-Git-Tag: r0-52-15~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8fab9b137e11c6897bb9ff9c474a932f5a5247d7;p=thirdparty%2Fnewt.git don't draw scale when not mapped --- diff --git a/scale.c b/scale.c index 3dbfca9..35dcdde 100644 --- a/scale.c +++ b/scale.c @@ -39,6 +39,7 @@ newtComponent newtScale(int left, int top, int width, long long fullValue) { co->top = top; co->left = left; co->takesFocus = 0; + co->isMapped = 0; sc->fullValue = fullValue; sc->charsSet = 0; @@ -85,7 +86,7 @@ static void scaleDraw(newtComponent co) { int xlabel = (co->width-4) /2; char percent[10]; - if (co->top == -1) return; + if (!co->isMapped) return; newtGotorc(co->top, co->left);