Use gimp-image-get-active-layer/channel instead of the passed drawable for

2004-04-05  Pedro Gimeno  <pggimeno@wanadoo.es>

	* plug-ins/script-fu/scripts/copy-visible.scm: Use
	gimp-image-get-active-layer/channel instead of the passed
	drawable for later restoring the initially active layer/channel.
	Addresses bug #138662.

	* plug-ins/script-fu/scripts/drop-shadow.scm: Add a call to
	gimp-image-set-active-layer in order for it to fail early instead
	of failing with the undo group open in case the drawable is not
	suitable for applying the effect.
This commit is contained in:
Pedro Gimeno 2004-04-05 21:35:03 +00:00 committed by Pedro Gimeno Fortea
parent b80d76ab50
commit bc7d7d5afe
3 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,15 @@
2004-04-05 Pedro Gimeno <pggimeno@wanadoo.es>
* plug-ins/script-fu/scripts/copy-visible.scm: Use
gimp-image-get-active-layer/channel instead of the passed
drawable for later restoring the initially active layer/channel.
Addresses bug #138662.
* plug-ins/script-fu/scripts/drop-shadow.scm: Add a call to
gimp-image-set-active-layer in order for it to fail early instead
of failing with the undo group open in case the drawable is not
suitable for applying the effect.
2004-04-05 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_real_mode_changed): update the

View File

@ -27,8 +27,12 @@
(let* ((layers (gimp-image-get-layers image))
(num-layers (car layers))
(num-visi-layers 0)
(curlayer (car (gimp-image-get-active-layer image)))
(layer-array (cadr layers)))
(if (= curlayer -1)
(set! curlayer (car (gimp-image-get-active-channel image))))
(gimp-image-undo-group-start image)
; copy all visible layers and make them invisible
@ -66,7 +70,9 @@
(gimp-drawable-set-visible layer (aref visi-array layer-count))
(set! layer-count (+ layer-count 1)))
(gimp-image-set-active-layer image drawable)
(if (= (car (gimp-drawable-is-layer curlayer)) 1)
(gimp-image-set-active-layer image curlayer)
(gimp-image-set-active-channel image curlayer))
(gimp-image-undo-group-end image)
(gimp-displays-flush)))

View File

@ -54,6 +54,8 @@
(active-selection 0)
(shadow-layer 0))
(gimp-image-set-active-layer image drawable)
(gimp-image-undo-group-start image)
(gimp-layer-add-alpha drawable)