1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors sequences fry math
4 opengl ui.pens ui.images io.pathnames ;
8 TUPLE: image-pen image fill? ;
10 : <image-pen> ( image-name -- pen ) f image-pen boa ;
12 M: image-pen draw-interior
13 [ dim>> ] [ [ image>> ] [ fill?>> ] bi ] bi*
14 [ draw-scaled-image ] [
15 [ image-dim [ - 2 /i ] 2map ] keep
16 '[ _ draw-image ] with-translation
19 M: image-pen pen-pref-dim nip image>> image-dim ;