; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
(define (sg-select-within-layer image drawable)
(let* ((layer (car (gimp-image-get-active-layer image))))
(if (= (car (gimp-selection-bounds image)) FALSE)
(gimp-selection-all image) )
(car (gimp-drawable-offsets layer))
(cadr (gimp-drawable-offsets layer))
(car (gimp-drawable-width layer))
(car (gimp-drawable-height layer))
CHANNEL-OP-INTERSECT 0 0 )
(gimp-image-undo-group-end image) )
_"Intersect selection with the boundaries of the active layer"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0