From: ewt Date: Wed, 4 Sep 1996 17:46:43 +0000 (+0000) Subject: don't update scale unless aboslutely necessary X-Git-Tag: v0-9~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53179ae321d960444ffc0f1172ad0d0e4727f899;p=thirdparty%2Fnewt.git don't update scale unless aboslutely necessary --- diff --git a/scale.c b/scale.c index a4b0020..97acd1b 100644 --- a/scale.c +++ b/scale.c @@ -42,9 +42,14 @@ newtComponent newtScale(int left, int top, int width, long long fullValue) { void newtScaleSet(newtComponent co, long long amount) { struct scale * sc = co->data; - sc->charsSet = (amount * co->width) / sc->fullValue; - - scaleDraw(co); + int newCharsSet; + + newCharsSet = (amount * co->width) / sc->fullValue; + + if (newCharsSet != sc->charsSet) { + sc->charsSet = newCharsSet; + scaleDraw(co); + } } static void scaleDraw(newtComponent co) {