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:
Michael Natterer 2006-09-01 21:27:42 +00:00 committed by Michael Natterer
parent d999499640
commit 4233734b86
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
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.
2006-09-01 Michael Natterer <mitch@gimp.org>
This commit *should* fix the remaining missing contexts for

View file

@ -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..."