[gimp] plug-ins: fix PDB proc script-fu-selection-to-pattern



commit 5e1dd03c52d260429a5d8f8a91fe0192b3f650f5
Author: lloyd konneker <konnekerl gmail com>
Date:   Thu May 5 09:00:11 2022 -0400

    plug-ins: fix PDB proc script-fu-selection-to-pattern
    
    Why: this commit fixes PATTERN using code that commit 708f3228  fixed for BRUSH.
    
    Importance:
    There doesn't seem to be any issues it resolves.
    No code in the GIMP repo seems to call this procedure.
    I don't know whether third party plug-ins rely on this procedure.
    Anyway, fix it so a brute force test works.

 plug-ins/script-fu/scripts/select-to-pattern.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/script-fu/scripts/select-to-pattern.scm 
b/plug-ins/script-fu/scripts/select-to-pattern.scm
index 071f702926..a96bb59af4 100644
--- a/plug-ins/script-fu/scripts/select-to-pattern.scm
+++ b/plug-ins/script-fu/scripts/select-to-pattern.scm
@@ -69,10 +69,15 @@
 
   (gimp-image-insert-layer pattern-image pattern-draw 0 0)
 
-  (gimp-edit-copy drawable)
+  (gimp-edit-copy 1 (vector drawable))
 
-  (let ((floating-sel (car (gimp-edit-paste pattern-draw FALSE))))
-    (gimp-floating-sel-anchor floating-sel))
+  (let* (
+           (pasted (gimp-edit-paste pattern-draw FALSE))
+           (num-pasted (car pasted))
+           (floating-sel (aref (cadr pasted) (- num-pasted 1)))
+          )
+    (gimp-floating-sel-anchor floating-sel)
+  )
 
   (set! filename2 (string-append gimp-directory
                                  "/patterns/"


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