parent
c4885ac082
commit
d1786adfe4
|
@ -144,6 +144,9 @@ PRIVATE>
|
|||
|
||||
GENERIC: write-gadget ( gadget stream -- )
|
||||
|
||||
M: filter-writer write-gadget
|
||||
stream>> write-gadget ;
|
||||
|
||||
M: pane-stream write-gadget ( gadget pane-stream -- )
|
||||
pane>> current>> swap add-gadget drop ;
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
USING: accessors hashtables images images.viewer io io.styles
|
||||
kernel math namespaces prettyprint.custom prettyprint.sections
|
||||
sequences ui.gadgets.panes ;
|
||||
FROM: images => image ;
|
||||
IN: images.viewer.prettyprint
|
||||
|
||||
TUPLE: image-section < section
|
||||
image ;
|
||||
|
||||
CONSTANT: approx-pixels-per-cell 8
|
||||
|
||||
: <image-section> ( image -- section )
|
||||
dup dim>> first approx-pixels-per-cell /i image-section new-section
|
||||
over >>image
|
||||
swap presented associate >>style ;
|
||||
|
||||
M: image-section long-section
|
||||
short-section ;
|
||||
M: image-section short-section
|
||||
image>> <image-gadget> output-stream get write-gadget ;
|
||||
|
||||
M: image pprint*
|
||||
<image-section> add-section ;
|
||||
|
Loading…
Reference in New Issue