Patch to Allow the erase every other row plugin to skip a different number of rows

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

 



A patch is attached to allow the "Erase every other line" plugin to
erase every n line, from 2 lines to 6 lines.

Patch is also in bugzilla: #327610

Philip Trickett

Patch Below:
[phil@nori scripts]$ diff -uN erase-rows.orig erase-rows.scm
--- erase-rows.orig     2006-01-18 22:39:05.000000000 +0000
+++ erase-rows.scm      2006-01-18 22:46:10.000000000 +0000
@@ -1,4 +1,4 @@
-(define (script-fu-erase-rows img drawable orientation which type)
+(define (script-fu-erase-rows img drawable orientation which type skip)
   (let* ((width (car (gimp-drawable-width drawable)))
         (height (car (gimp-drawable-height drawable)))
         (position-x (car (gimp-drawable-offsets drawable)))
@@ -13,7 +13,16 @@
                           (if (= type 0)
                               (gimp-edit-clear drawable)
                               (gimp-edit-fill drawable BACKGROUND-FILL))
-                          (loop (+ i 2) max)))))))
+                          (if (= skip 0)
+                           (loop (+ i 2) max))
+                          (if (= skip 1)
+                           (loop (+ i 3) max))
+                          (if (= skip 2)
+                            (loop (+ i 4) max))
+                           (if (= skip 3)
+                            (loop (+ i 5) max))
+                          (if (= skip 4)
+                            (loop (+ i 6) max)))))))
       (loop (if (= which 0)
                0
                1)
@@ -25,11 +34,11 @@
     (gimp-displays-flush)))

 (script-fu-register "script-fu-erase-rows"
-                   _"_Erase every other Row..."
+                   _"_Erase every n Row..."
                    "Erase every other row/column with the background color"
+                   "Federico Mena Quintero, Philip Trickett (adjusted)"
                    "Federico Mena Quintero"
-                   "Federico Mena Quintero"
-                   "June 1997"
+                   "June 1997, Jan 2006"
                    "RGB* GRAY* INDEXED*"
                    SF-IMAGE     "Image"      0
                    SF-DRAWABLE  "Drawable"   0

_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux