Fix Makefile whitespace errors
[shapes.git] / examples / metapdf_examples / drawable.mpdf
blobb0eeee91736ac2875ed633509c59c26ca743cbb5
1 include circle.mpdf
3 [ Box ::
4   [class (`Box´ _ll _ur) isa ((Drawable))
5   (__members__
6    (ll _ll)
7    (ur _ur))
8   (__methods__
9    (^ [leftpoint n i] (i/(n+1))*ll+(1-i/(n+1))*(ll.x,ur.y))
10   )
11   (__overrides< Drawable >__
12    ([bbox] [rectangle ll ur])
13    ([draw] [stroke [rectangle ll ur]])
14   )
15   ]
18 [ mark :: [-> p] {[stroking RGB_RED] [width 0.3bp] [stroke [[shift p] [circle 0.5mm]]]} ]
20 [width 0.25bp]
22 [ b :: [Box.new (0.5cm,0.7cm) (1.3cm,0.9cm)] ]
23 [ tb :: [[shift (~5mm,3mm)]*[rotate 15°] b] ]
25 [width 5bp]
27 [draw tb]
28 [draw b]
30 [mark [b.Box#leftpoint 3 1]]
31 [mark [b.Box#leftpoint 3 3]]
33 [mark [tb.Box#leftpoint 3 1]]
34 [mark [tb.Box#leftpoint 3 3]]
37 /* Just draw anything to avoid empty-output error */
38 [stroke (0cm,0cm)--(1cm,1cm)]