diff --git a/ChangeLog b/ChangeLog index 6bae40d384..4d863d41ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-05-04 Mukund Sivaraman + + * plug-ins/common/edge.c: reduced the number of progress updates. + 2007-05-04 Mukund Sivaraman * plug-ins/common/fractaltrace.c: whoops. fixed progress when diff --git a/plug-ins/common/edge.c b/plug-ins/common/edge.c index 78f55e0773..dd86543771 100644 --- a/plug-ins/common/edge.c +++ b/plug-ins/common/edge.c @@ -278,6 +278,7 @@ edge (GimpDrawable *drawable) gint maxval; gint cur_progress; gint max_progress; + gdouble per_progress; if (evals.amount < 1.0) evals.amount = 1.0; @@ -297,7 +298,8 @@ edge (GimpDrawable *drawable) maxval = 255; cur_progress = 0; - max_progress = (x2 - x1) * (y2 - y1); + per_progress = 0.0; + max_progress = (x2 - x1) * (y2 - y1) / 100; gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1, x2-x1, y2-y1, FALSE, FALSE); gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, x2-x1, y2-y1, TRUE, TRUE); @@ -384,9 +386,17 @@ edge (GimpDrawable *drawable) } } cur_progress += dest_rgn.w * dest_rgn.h; - gimp_progress_update ((double) cur_progress / (double) max_progress); + + if (cur_progress > max_progress) + { + cur_progress = cur_progress - max_progress; + per_progress = per_progress + 0.01; + gimp_progress_update (per_progress); + } } + gimp_progress_update (1.0); + gimp_pixel_fetcher_destroy (pft); gimp_drawable_flush (drawable);