[gimp/gimp-2-10] Issue #3341 - Add Bevel doesn't work for high thickness values



commit 7072c20bb929a5176931cdd0b2171908f3bc193f
Author: Ell <ell_se yahoo com>
Date:   Mon Aug 12 22:08:51 2019 +0300

    Issue #3341 - Add Bevel doesn't work for high thickness values
    
    Something during the port to gimp-drawable-edit (commit
    233ac80de16c89ddef4397fe1a09907354b45b92) broke add-bevel.scm when
    the thickness is high enough for the selection to become empty.
    
    Add an explicit check for a selection while constructing the bump-
    map layer.
    
    (cherry picked from commit 21649c5eaa68dd0a3e117271eb65b15275f5ee65)

 plug-ins/script-fu/scripts/add-bevel.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/add-bevel.scm b/plug-ins/script-fu/scripts/add-bevel.scm
index 374e5ceea6..6e0f951f24 100644
--- a/plug-ins/script-fu/scripts/add-bevel.scm
+++ b/plug-ins/script-fu/scripts/add-bevel.scm
@@ -117,7 +117,9 @@
     (gimp-context-set-background '(0 0 0))
     (gimp-drawable-fill bump-layer FILL-BACKGROUND)
 
-    (while (< index thickness)
+    (while (and (< index thickness)
+                (= (car (gimp-selection-is-empty image)) FALSE)
+           )
            (set! greyness (/ (* index 255) thickness))
            (gimp-context-set-background (list greyness greyness greyness))
            ;(gimp-selection-feather image 1) ;Stop the slopey jaggies?
@@ -126,8 +128,12 @@
            (set! index (+ index 1))
     )
     ; Now the white interior
-    (gimp-context-set-background '(255 255 255))
-    (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND)
+    (if (= (car (gimp-selection-is-empty image)) FALSE)
+        (begin
+          (gimp-context-set-background '(255 255 255))
+          (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND)
+        )
+    )
 
     ;------------------------------------------------------------
     ;


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