pop the context before rendering the gradient so we draw the gradient with
2006-09-01 Michael Natterer <mitch@gimp.org> * plug-ins/script-fu/scripts/gradient-example.scm: pop the context before rendering the gradient so we draw the gradient with the user's colors, not with the ones the script uses temporarily.
This commit is contained in:
committed by
Michael Natterer
parent
d999499640
commit
4233734b86
@ -31,17 +31,19 @@
|
||||
(fg-color (* 255 (/ 2 3)))
|
||||
(bg-color (* 255 (/ 1 3))))
|
||||
|
||||
(gimp-context-push)
|
||||
|
||||
(gimp-image-undo-disable img)
|
||||
(gimp-image-add-layer img drawable 0)
|
||||
|
||||
; Render background checkerboard
|
||||
|
||||
(gimp-context-push)
|
||||
|
||||
(gimp-context-set-foreground (list fg-color fg-color fg-color))
|
||||
(gimp-context-set-background (list bg-color bg-color bg-color))
|
||||
(plug-in-checkerboard 1 img drawable 0 8)
|
||||
|
||||
(gimp-context-pop)
|
||||
|
||||
; Render gradient
|
||||
|
||||
(gimp-edit-blend drawable CUSTOM-MODE NORMAL-MODE
|
||||
@ -51,9 +53,7 @@
|
||||
|
||||
; Terminate
|
||||
(gimp-image-undo-enable img)
|
||||
(gimp-display-new img)
|
||||
|
||||
(gimp-context-pop)))
|
||||
(gimp-display-new img)))
|
||||
|
||||
(script-fu-register "script-fu-gradient-example"
|
||||
_"Render _Image..."
|
||||
|
||||
Reference in New Issue
Block a user