[gimp] app: update the progress also when converting the selection's precision



commit 58506568e5e3836ac34018fe6616d2ce2e236bfb
Author: Michael Natterer <mitch gimp org>
Date:   Mon Oct 1 13:36:50 2012 +0200

    app: update the progress also when converting the selection's precision

 app/core/gimpimage-convert-precision.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimpimage-convert-precision.c b/app/core/gimpimage-convert-precision.c
index b009c92..682f891 100644
--- a/app/core/gimpimage-convert-precision.c
+++ b/app/core/gimpimage-convert-precision.c
@@ -57,7 +57,7 @@ gimp_image_convert_precision (GimpImage     *image,
   all_drawables = g_list_concat (gimp_image_get_layer_list (image),
                                  gimp_image_get_channel_list (image));
 
-  n_drawables = g_list_length (all_drawables);
+  n_drawables = g_list_length (all_drawables) + 1 /* + selection */;
 
   switch (precision)
     {
@@ -129,6 +129,12 @@ gimp_image_convert_precision (GimpImage     *image,
 
     gimp_drawable_set_buffer (GIMP_DRAWABLE (mask), FALSE, NULL, buffer);
     g_object_unref (buffer);
+
+    nth_drawable++;
+
+    if (progress)
+      gimp_progress_set_value (progress,
+                               (gdouble) nth_drawable / (gdouble) n_drawables);
   }
 
   gimp_image_undo_group_end (image);



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