[gimp] script-fu: in slide, use an undo group when working on the initial image



commit d01bf70f86bdd16e109dd405c71717bbac8d8a99
Author: Thomas Manni <thomas manni free fr>
Date:   Tue May 15 17:55:25 2018 +0200

    script-fu: in slide, use an undo group when working on the initial image

 plug-ins/script-fu/scripts/slide.scm |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/slide.scm b/plug-ins/script-fu/scripts/slide.scm
index d42ee13..f83a313 100644
--- a/plug-ins/script-fu/scripts/slide.scm
+++ b/plug-ins/script-fu/scripts/slide.scm
@@ -100,7 +100,10 @@
   (gimp-context-set-opacity 100.0)
   (gimp-context-set-feather FALSE)
 
-  (gimp-image-undo-disable image)
+  (if (= work-on-copy TRUE)
+      (gimp-image-undo-disable image)
+      (gimp-image-undo-group-start image)
+  )
 
 ; add an alpha channel to the image
   (gimp-layer-add-alpha pic-layer)
@@ -223,9 +226,13 @@
 
 ; clean up after the script
   (gimp-selection-none image)
-  (gimp-image-undo-enable image)
+
   (if (= work-on-copy TRUE)
+    (begin
       (gimp-display-new image)
+      (gimp-image-undo-enable image)
+    )
+    (gimp-image-undo-group-end image)
   )
 
   (gimp-displays-flush)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]