[Gimp-developer] Expected behaviour of reset for levels dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Someone on the #gimp IRC channel was asking about the expected
behaviour of the Reset button in the Image->Colors->Levels dialog
yesterday. They found that after an Auto adjust that Reset only
changed the active channel values to their defaults, and left the
others as they were. He expected it to reset all the channels at
once. 

This isn't a bug, as such, and if this is expected behaviour then
I just wanted to know, so that I can let him know. If it isn't
expected, the patch attached below will reset all channels to
their original values, and it can be added to both gimp-1-2 and
HEAD (in app/levels.c and app/tools/levels.c respectively). In
gimp-1-2 channel needs to be declared as gint in the function -
it's declared already in HEAD.

Cheers,
Dave.

-- 
  .------------------------------.
 /          David Neary,          \
|     E-Mail dneary@xxxxxxxxxx     | 
 \     Phone +353-1-872-0654      /
  `------------------------------'
Index: levels.c
===================================================================
RCS file: /cvs/gnome/gimp/app/tools/levels.c,v
retrieving revision 1.60
diff -u -r1.60 levels.c
--- levels.c	2001/01/24 22:35:14	1.60
+++ levels.c	2001/03/14 13:34:32
@@ -1006,11 +1006,14 @@
 
   ld = (LevelsDialog *) data;
 
-  ld->low_input[ld->channel]   = 0;
-  ld->gamma[ld->channel]       = 1.0;
-  ld->high_input[ld->channel]  = 255;
-  ld->low_output[ld->channel]  = 0;
-  ld->high_output[ld->channel] = 255;
+  for (channel = 0; channel < 4; channel ++)
+    {
+      ld->low_input[channel]   = 0;
+      ld->gamma[channel]       = 1.0;
+      ld->high_input[channel]  = 255;
+      ld->low_output[channel]  = 0;
+      ld->high_output[channel] = 255;
+    }
 
   levels_update (ld, ALL);
   

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux