Bill Skaggs <weskaggs@primate.ucdavis.edu>

* plug-ins/common/sparkle.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/common/struc.c
	* plug-ins/common/tileit.c
	* plug-ins/common/warp.c
	* plug-ins/common/whirlpinch.c
	* plug-ins/common/wind.c: handle situation where intersection
	of selection and drawable is empty; progress on bug #155733.
This commit is contained in:
William Skaggs 2005-03-21 23:59:12 +00:00
parent 1cc9701bed
commit 8d0a6f5cf1
8 changed files with 81 additions and 25 deletions

View File

@ -1,3 +1,14 @@
2005-03-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/common/sparkle.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/struc.c
* plug-ins/common/tileit.c
* plug-ins/common/warp.c
* plug-ins/common/whirlpinch.c
* plug-ins/common/wind.c: handle situation where intersection
of selection and drawable is empty; progress on bug #155733.
2005-03-21 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimptransformtool.c

View File

@ -203,6 +203,7 @@ run (const gchar *name,
GimpDrawable *drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint x, y, w, h;
run_mode = param[0].data.d_int32;
@ -216,6 +217,12 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
if (! gimp_drawable_mask_intersect (drawable->drawable_id, &x, &y, &w, &h))
{
g_message (_("Region selected for filter is empty"));
return;
}
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
switch (run_mode)

View File

@ -3026,6 +3026,7 @@ run (const gchar *name,
GimpDrawable *drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint x, y, w, h;
run_mode = param[0].data.d_int32;
@ -3039,6 +3040,12 @@ run (const gchar *name,
drawable = gimp_drawable_get (param[2].data.d_drawable);
if (! gimp_drawable_mask_intersect (drawable->drawable_id, &x, &y, &w, &h))
{
g_message (_("Region selected for plug-in is empty"));
return;
}
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:

View File

@ -1370,7 +1370,9 @@ strucpi (GimpDrawable *drawable,
* need to be done for correct operation. (It simply makes it go
* faster, since fewer pixels need to be operated on).
*/
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&x1, &y1, &x2, &y2))
return;
/* Get the size of the input image. (This will/must be the same
* as the size of the output image.

View File

@ -256,8 +256,12 @@ run (const gchar *name,
has_alpha = gimp_drawable_has_alpha (tileitdrawable->drawable_id);
gimp_drawable_mask_bounds (drawable->drawable_id,
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&sel_x1, &sel_y1, &sel_x2, &sel_y2))
{
g_message (_("Region selected for filter is empty."));
return;
}
sel_width = sel_x2 - sel_x1;
sel_height = sel_y2 - sel_y1;

View File

@ -352,12 +352,15 @@ run (const gchar *name,
values[0].data.d_status = status;
image_ID = gimp_drawable_get_image (map_x->drawable_id);
if (map_x)
{
image_ID = gimp_drawable_get_image (map_x->drawable_id);
gimp_drawable_detach (map_x);
gimp_drawable_detach (map_y);
gimp_drawable_detach (map_x);
gimp_drawable_detach (map_y);
gimp_image_delete (image_ID);
gimp_image_delete (image_ID);
}
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
@ -754,7 +757,9 @@ blur16 (GimpDrawable *drawable)
/* --------------------------------------- */
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&x1, &y1, &x2, &y2))
return;
width = drawable->width; /* size of input drawable*/
height = drawable->height;
@ -925,7 +930,9 @@ diff (GimpDrawable *drawable,
* need to be done for correct operation. (It simply makes it go
* faster, since fewer pixels need to be operated on).
*/
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&x1, &y1, &x2, &y2))
return;
/* Get the size of the input image. (This will/must be the same
* as the size of the output image.
@ -1227,7 +1234,9 @@ warp (GimpDrawable *orig_draw,
diff (disp_map, &xdlayer, &ydlayer); /* generate x,y differential images (arrays) */
/* Get selection area */
gimp_drawable_mask_bounds (orig_draw->drawable_id, &x1, &y1, &x2, &y2);
if (! gimp_drawable_mask_intersect (orig_draw->drawable_id,
&x1, &y1, &x2, &y2))
return;
width = orig_draw->width;
height = orig_draw->height;
@ -1342,7 +1351,10 @@ warp_one (GimpDrawable *draw,
/* Get selection area */
gimp_drawable_mask_bounds (draw->drawable_id, &x1, &y1, &x2, &y2);
if (! gimp_drawable_mask_bounds (draw->drawable_id,
&x1, &y1, &x2, &y2))
return;
width = draw->width;
height = draw->height;
dest_bytes = draw->bpp;

View File

@ -190,8 +190,12 @@ run (const gchar *name,
img_bpp = gimp_drawable_bpp (drawable->drawable_id);
img_has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
gimp_drawable_mask_bounds (drawable->drawable_id,
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&sel_x1, &sel_y1, &sel_x2, &sel_y2))
{
g_message (_("Region affected by plug-in is empty"));
return;
}
/* Set the tile cache size */
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);

View File

@ -310,14 +310,19 @@ render_blast (GimpDrawable *drawable,
}
else
{
gimp_progress_init (_("Rendering Blast..."));
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
if (gimp_drawable_mask_intersect (drawable->drawable_id,
&x1, &y1, &x2, &y2))
{
gimp_progress_init (_("Rendering Blast..."));
width = x2 - x1;
height = y2 - y1;
width = x2 - x1;
height = y2 - y1;
gimp_pixel_rgn_init (&dest_region, drawable,
x1, y1, width, height, TRUE, TRUE);
gimp_pixel_rgn_init (&dest_region, drawable,
x1, y1, width, height, TRUE, TRUE);
}
else
return;
}
gimp_pixel_rgn_init (&src_region, drawable,
@ -433,14 +438,18 @@ render_wind (GimpDrawable *drawable,
}
else
{
gimp_progress_init (_("Rendering Wind..."));
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
if (gimp_drawable_mask_intersect (drawable->drawable_id, &x1, &y1, &x2, &y2))
{
gimp_progress_init (_("Rendering Wind..."));
width = x2 - x1;
height = y2 - y1;
width = x2 - x1;
height = y2 - y1;
gimp_pixel_rgn_init (&dest_region, drawable,
x1, y1, width, height, TRUE, TRUE);
gimp_pixel_rgn_init (&dest_region, drawable,
x1, y1, width, height, TRUE, TRUE);
}
else
return;
}
gimp_pixel_rgn_init (&src_region, drawable,