[Gimp-developer] gimp-context-set-brush-size. Why doesn't it work?



I've started writing a script. Within the script I've adjusted the brush size
using gimp-context-set-brush-size. After running the script, the brush size
has changed in the "Tool Options" area but when the script starts the
drawing process, it ignores the "Tool Options" and draws using the brush
default size of 180 by 180 pixels. 

I primarily believe such problems are user errors. So what have I done
incorrectly?

*CODE*

(define (script-fu-acrylic-spot image drawable )

   (let* 

       (
         (width (car (gimp-image-width image)))
         (height (car (gimp-image-height image)))
         (points (make-vector 2 'double))
         (x1 (* width 0.5))
         (y1 (* height 0.5))
         (brush-size-1 (* width 0.3))
       )

;undo
(gimp-image-undo-group-start image)
;undo

             (gimp-context-set-foreground '(0 0 0))
             (gimp-context-set-brush "Acrylic 01")
             (gimp-context-set-brush-size brush-size-1)
             
             (vector-set! points 0 x1) 
             (vector-set! points 1 y1)
                     
             (gimp-paintbrush drawable 0 2 points PAINT-CONSTANT 0)
 
;undo
(gimp-image-undo-group-end image)
(gimp-displays-flush)
;undo
   )  
    
)

(script-fu-register "script-fu-acrylic-spot"
            "<Image>/Filters/acrylic spot"
            "Testing Script"
            "PD"   
            "PD"   
            "2012"
            ""           
            SF-IMAGE "image" 0
            SF-DRAWABLE "drawable" 0
            
)

All input is truly appreciated.

Thank you.



--
View this message in context: http://gimp.1065349.n5.nabble.com/gimp-context-set-brush-size-Why-doesn-t-it-work-tp34797.html
Sent from the Developers mailing list archive at Nabble.com.


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