Commit 806d2606 authored by Thomas Manni's avatar Thomas Manni

script-fu: in weave, improve context and undo management

Use a gimp-context-push/pop at the beginning/end of the script
to keep the current context unchanged.

Add undo support for the whole procedure.
parent a69b8a25
......@@ -351,6 +351,9 @@
thread-length
thread-density
thread-intensity)
(gimp-context-push)
(gimp-image-undo-group-start img)
(let* (
(d-img (car (gimp-item-get-image drawable)))
(d-width (car (gimp-drawable-width drawable)))
......@@ -370,7 +373,6 @@
(w-layer (cadr weaving))
)
(gimp-context-push)
(gimp-context-set-paint-mode LAYER-MODE-NORMAL)
(gimp-context-set-opacity 100.0)
(gimp-context-set-feather FALSE)
......@@ -385,11 +387,10 @@
(gimp-layer-set-mode floating-sel LAYER-MODE-MULTIPLY)
(gimp-floating-sel-to-layer floating-sel)
)
(gimp-displays-flush)
(gimp-context-pop)
)
(gimp-context-pop)
(gimp-image-undo-group-end img)
(gimp-displays-flush)
)
(script-fu-register "script-fu-weave"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment