| 1 |
lars |
1 |
% $Header: /cvsroot/html2ps/postscript/flow.inline.block.ps,v 1.1 2005/12/18 07:21:38 Konstantin Exp $
|
|
|
2 |
|
|
|
3 |
/flow-inline-block {
|
|
|
4 |
% inline-block margins are never collapsed
|
|
|
5 |
% While drawing, we need position of margin edge, not border edge.
|
|
|
6 |
1 index get-current-x
|
|
|
7 |
2 index get-current-y % => Parent Child X Y
|
|
|
8 |
2 index
|
|
|
9 |
move-to-box % => Parent Child
|
|
|
10 |
|
|
|
11 |
2 copy inline-block-calc-width
|
|
|
12 |
|
|
|
13 |
% we're now interested in last content y, not the bottom border of the containing
|
|
|
14 |
% block, because, due the min-height, bottom border can contain lesser (lower on the page)
|
|
|
15 |
% value than current y
|
|
|
16 |
dup get-right
|
|
|
17 |
2 index put-current-x
|
|
|
18 |
|
|
|
19 |
% determine the baseline of inline-block box
|
|
|
20 |
{
|
|
|
21 |
get-baseline max
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
2 index get-content
|
|
|
25 |
reduce
|
|
|
26 |
% now we have text baseline counted from the padding edge;
|
|
|
27 |
% add padding, margin and border size on the top size of inline-block box to
|
|
|
28 |
% calculate its own baseline
|
|
|
29 |
1 index get-margin-top add
|
|
|
30 |
1 index get-padding-top add
|
|
|
31 |
1 index get-border-top-width add
|
|
|
32 |
|
|
|
33 |
1 index put-baseline
|
|
|
34 |
|
|
|
35 |
dup get-vertical-align exec
|
|
|
36 |
|
|
|
37 |
% do horizontal align
|
|
|
38 |
% treat inline-block content as one long line box
|
|
|
39 |
dup get-content { % => Parent Box ContentElement
|
|
|
40 |
1 index append-line
|
|
|
41 |
} forall
|
|
|
42 |
|
|
|
43 |
dup get-text-align
|
|
|
44 |
1 index exch
|
|
|
45 |
exec
|
|
|
46 |
|
|
|
47 |
% append current box to the parent's line box
|
|
|
48 |
dup 2 index append-line
|
|
|
49 |
|
|
|
50 |
dup get-full-height
|
|
|
51 |
2 index exch
|
|
|
52 |
extend-height % => Parent
|
|
|
53 |
pop
|
|
|
54 |
|
|
|
55 |
% clear the stack
|
|
|
56 |
pop pop
|
|
|
57 |
} def
|