3
;; Alan Horkan 2004. Copyright.
4
;; I'll fix it and license it differntly later if anyone cares to ask
6
(define (script-fu-guide-new-percent image
10
(let* ((width (car (gimp-drawable-width drawable)))
11
(height (car (gimp-drawable-height drawable))))
12
(gimp-image-undo-group-start image)
15
(set! position (/ (* height position) 100))
16
(set! position (/ (* width position) 100)))
19
;; convert position to pixel
20
(if (< position height) (gimp-image-add-hguide image position))
21
(if (< position width) (gimp-image-add-vguide image position)))
23
(gimp-image-undo-group-end image)
24
(gimp-displays-flush)))
26
(script-fu-register "script-fu-guide-new-percent"
27
_"New Guide (by _Percent)..."
28
"Add a single Line Guide with the specified postion. Position specified as a percent of the image size."
33
SF-IMAGE "Input Image" 0
34
SF-DRAWABLE "Input Drawable" 0
35
SF-OPTION _"Direction" '(_"Horizontal"
37
SF-ADJUSTMENT _"Position (in %)" '(50 0 100 1 10 0 1))
39
(script-fu-menu-register "script-fu-guide-new-percent"
40
"<Image>/Image/Guides")