Issue #3341 - Add Bevel doesn't work for high thickness values

Something during the port to gimp-drawable-edit (commit
233ac80de1) 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.
This commit is contained in:
Ell 2019-08-12 22:08:51 +03:00
parent 79d92a5d05
commit 21649c5eaa
1 changed files with 9 additions and 3 deletions

View File

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