]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't update scale unless aboslutely necessary
authorewt <ewt>
Wed, 4 Sep 1996 17:46:43 +0000 (17:46 +0000)
committerewt <ewt>
Wed, 4 Sep 1996 17:46:43 +0000 (17:46 +0000)
scale.c

diff --git a/scale.c b/scale.c
index a4b00209faa43350b2a933f39efb2eba7fb246ca..97acd1b64f4cd3b395316917232a2c64f14a66d3 100644 (file)
--- 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) {