reduced the number of progress updates.

2007-05-04  Mukund Sivaraman  <muks@mukund.org>

        * plug-ins/common/edge.c: reduced the number of progress updates.


svn path=/trunk/; revision=22408
This commit is contained in:
Mukund Sivaraman 2007-05-04 11:16:51 +00:00 committed by Mukund Sivaraman
parent 6fcabcac46
commit 2a7d1e524d
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2007-05-04 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/edge.c: reduced the number of progress updates.
2007-05-04 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/fractaltrace.c: whoops. fixed progress when

View file

@ -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);