~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/script-fu/scripts/pupi-button.scm

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
; The corresponding parameters have been replaced by an SF-FONT parameter.
12
12
; ************************************************************************
13
13
;
14
 
; This program is free software; you can redistribute it and/or modify
 
14
; This program is free software: you can redistribute it and/or modify
15
15
; it under the terms of the GNU General Public License as published by
16
 
; the Free Software Foundation; either version 2 of the License, or
 
16
; the Free Software Foundation; either version 3 of the License, or
17
17
; (at your option) any later version.
18
18
;
19
19
; This program is distributed in the hope that it will be useful,
22
22
; GNU General Public License for more details.
23
23
;
24
24
; You should have received a copy of the GNU General Public License
25
 
; along with this program; if not, write to the Free Software
26
 
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
; along with this program.  If not, see <http://www.gnu.org/licenses/>.
27
26
 
28
27
(define (script-fu-round-button text
29
28
                                size
83
82
                        height
84
83
                        ratio)
85
84
    (let* ((diameter (* ratio height)))
86
 
      (gimp-ellipse-select img x y diameter height CHANNEL-OP-ADD FALSE 0 0)
87
 
      (gimp-ellipse-select img (+ x (- width diameter)) y
88
 
                           diameter height CHANNEL-OP-ADD FALSE 0 0)
89
 
      (gimp-rect-select img (+ x (/ diameter 2)) y
90
 
                        (- width diameter) height CHANNEL-OP-ADD FALSE 0)))
 
85
      (gimp-image-select-ellipse img CHANNEL-OP-ADD x y diameter height)
 
86
      (gimp-image-select-ellipse img CHANNEL-OP-ADD (+ x (- width diameter)) y
 
87
                           diameter height)
 
88
      (gimp-image-select-rectangle img CHANNEL-OP-ADD (+ x (/ diameter 2)) y
 
89
                        (- width diameter) height)))
91
90
 
92
91
  (let* (
93
92
        (text-extents (gimp-text-get-extents-fontname text
115
114
        )
116
115
 
117
116
    (gimp-context-push)
118
 
 
 
117
    (gimp-context-set-antialias FALSE)
 
118
    (gimp-context-set-feather FALSE)
119
119
    (gimp-image-undo-disable img)
120
120
 
121
121
    ; Create bumpmap layer
122
122
 
123
 
    (gimp-image-add-layer img bumpmap -1)
 
123
    (gimp-image-insert-layer img bumpmap 0 -1)
124
124
    (gimp-selection-none img)
125
125
    (gimp-context-set-background '(0 0 0))
126
126
    (gimp-edit-fill bumpmap BACKGROUND-FILL)
135
135
 
136
136
    ; Create gradient layer
137
137
 
138
 
    (gimp-image-add-layer img gradient -1)
 
138
    (gimp-image-insert-layer img gradient 0 -1)
139
139
    (gimp-edit-clear gradient)
140
140
    (round-select img 0 0 width height ratio)
141
141
    (gimp-context-set-foreground ul-color)