[gimp] plug-ins: plasma, port to gimp_drawable_mask_intersect



commit 2fbc0b3389eeb7fdd42db978702d2427ece37847
Author: Mikael Magnusson <mikachu src gnome org>
Date:   Sun Apr 10 16:16:35 2011 +0200

    plug-ins: plasma, port to gimp_drawable_mask_intersect

 plug-ins/common/plasma.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/common/plasma.c b/plug-ins/common/plasma.c
index aa7df00..a9a72a1 100644
--- a/plug-ins/common/plasma.c
+++ b/plug-ins/common/plasma.c
@@ -390,6 +390,9 @@ plasma (GimpDrawable *drawable,
 
   pft = init_plasma (drawable, preview_mode, gr);
 
+  if (!preview_mode && !pft)
+    return;
+
   if (ix1 != ix2 && iy1 != iy2)
     {
       /*
@@ -433,13 +436,17 @@ init_plasma (GimpDrawable *drawable,
 
       pft = NULL;
     }
-  else
+  else if (gimp_drawable_mask_intersect (drawable->drawable_id,
+                                         &ix1, &iy1, &ix2, &iy2))
     {
-      gimp_drawable_mask_bounds (drawable->drawable_id,
-                                 &ix1, &iy1, &ix2, &iy2);
-
+      ix2 += ix1;
+      iy2 += iy1;
       pft = gimp_pixel_fetcher_new (drawable, TRUE);
     }
+  else
+    {
+      return NULL;
+    }
 
   bpp       = drawable->bpp;
   has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);



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