Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 35 lines (26 sloc) 0.716 kb
e092701 @unhammer layer-cover-image, layer-to-selection
authored
1 (script-fu-register "layer-cover-image"
2 "<Image>/Layer/Scale and move layer to canvas"
3
4 "Make the currently selected layer the same size and position
5 as the canvas (image)"
6
7 "(c) Kevin Brubeck Unhammer <unhammer(at)gmail.com>"
8 "Published under GPL version 2"
9 "May 24, 2009"
10 "*"
11
12 SF-IMAGE "Image" 0
13 SF-DRAWABLE "Drawable" 0
14 )
15
16 (define (layer-cover-image image drawable)
17
10bc15c @unhammer layer-cover-image, and layer-to-selection tested and works in 2.7.5, sat...
authored
18 (gimp-image-undo-group-start image)
e092701 @unhammer layer-cover-image, layer-to-selection
authored
19
20 (let* ((width (car (gimp-image-width image)))
21 (height (car (gimp-image-height image))))
22 (gimp-layer-scale
23 drawable
24 width
25 height
26 1 ))
27
28 (gimp-layer-set-offsets drawable
29 0
30 0)
31
10bc15c @unhammer layer-cover-image, and layer-to-selection tested and works in 2.7.5, sat...
authored
32 (gimp-image-undo-group-end image)
e092701 @unhammer layer-cover-image, layer-to-selection
authored
33 (gimp-displays-flush)
34 )
Something went wrong with that request. Please try again.