[gimp] Fixed deprecation warning and script breakage (see bug #646993)



commit c556a8fdabac00f663b9bc9a69afd7ce46986f82
Author: Kevin Cozens <kcozens svn gnome org>
Date:   Mon Aug 29 13:53:29 2011 -0400

    Fixed deprecation warning and script breakage (see bug #646993)
    
    Fixed deprecation warning. Fixed script breakage when "Add shadow" was checked
    due to error in order of arguments. Made chris-color-edge a private procedure.

 plug-ins/script-fu/scripts/fuzzyborder.scm |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/fuzzyborder.scm b/plug-ins/script-fu/scripts/fuzzyborder.scm
index abac939..54e73e7 100644
--- a/plug-ins/script-fu/scripts/fuzzyborder.scm
+++ b/plug-ins/script-fu/scripts/fuzzyborder.scm
@@ -34,6 +34,15 @@
                                 inFlatten
         )
 
+  (define (chris-color-edge inImage inLayer inColor inSize)
+    (gimp-selection-all inImage)
+    (gimp-selection-shrink inImage inSize)
+    (gimp-selection-invert inImage)
+    (gimp-context-set-background inColor)
+    (gimp-edit-fill inLayer BACKGROUND-FILL)
+    (gimp-selection-none inImage)
+  )
+
   (let (
        (theWidth (car (gimp-image-width inImage)))
        (theHeight (car (gimp-image-height inImage)))
@@ -42,6 +51,7 @@
        )
 
     (gimp-context-push)
+    (gimp-context-set-defaults)
 
     (gimp-selection-all inImage)
     (set! theImage (if (= inCopy TRUE)
@@ -80,7 +90,7 @@
     (chris-color-edge theImage theLayer inColor 1)
     (gimp-layer-scale theLayer theWidth theHeight TRUE)
 
-    (gimp-selection-layer-alpha theLayer)
+    (gimp-image-select-item theImage CHANNEL-OP-REPLACE theLayer)
     (gimp-selection-invert theImage)
     (gimp-edit-clear theLayer)
     (gimp-selection-invert theImage)
@@ -92,13 +102,12 @@
 
     (if (= inBlur TRUE)
         (plug-in-gauss-rle RUN-NONINTERACTIVE
-			   theImage theLayer inSize TRUE TRUE)
+                           theImage theLayer inSize TRUE TRUE)
     )
     (if (= inShadow TRUE)
         (begin
-          (gimp-selection-none inImage)
-          (gimp-image-insert-layer theImage -1
-                                (car (gimp-layer-copy theLayer FALSE)) 0)
+          (gimp-image-insert-layer theImage
+                                   (car (gimp-layer-copy theLayer FALSE)) 0 -1)
           (gimp-layer-scale theLayer
                             (- theWidth inSize) (- theHeight inSize) TRUE)
           (gimp-desaturate theLayer)
@@ -133,15 +142,6 @@
   )
 )
 
-(define (chris-color-edge inImage inLayer inColor inSize)
-  (gimp-selection-all inImage)
-  (gimp-selection-shrink inImage inSize)
-  (gimp-selection-invert inImage)
-  (gimp-context-set-background inColor)
-  (gimp-edit-fill inLayer BACKGROUND-FILL)
-  (gimp-selection-none inImage)
-)
-
 (script-fu-register "script-fu-fuzzy-border"
   _"_Fuzzy Border..."
   _"Add a jagged, fuzzy border to an image"



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