[NTG-context] Why do I see the outline of the green box in this METAPOST code?
Gerben Wierda
gerben.wierda at rna.nl
Sat Mar 14 16:29:24 CET 2020
Code:
vardef Foo(expr w, h, lh) =
save pth; path pth;
save pthtwo; path pthtwo;
save pththree; path pththree;
save pic; picture pic;
pth = fullsquare xysized (w, h);
pthtwo = fullsquare xysized (2*lh, lh) shifted (-w/2, 2.5*lh);
pththree = fullsquare xysized (2*lh, lh) shifted (-w/2, lh);
fill pth withcolor green;
fill pthtwo withcolor yellow;
fill pththree withcolor yellow;
pic := image (
draw pth;
draw pthtwo;
draw pththree;
);
% setbounds pic to pth;
pic
enddef ;
Call:
\startMPpage
picture s ; s := Foo(8cm, 2cm, 0.25cm);
draw s;
drawdot center leftboundary s withpen pencircle scaled 2 withcolor green;
drawdot center rightboundary s withpen pencircle scaled 2 withcolor blue;
drawdot point .25 along topboundary s withpen pencircle scaled 2 withcolor yellow;
drawdot .25[llcorner s, lrcorner s] withpen pencircle scaled 2 withcolor magenta;
drawdot origin withpen pencircle scaled 4 withcolor red;
\stopMPpage
Output:
Why is the outline of the green box visible in the yellow boxes? And how can I prevent this from happening?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200314/53827149/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.pdf
Type: application/pdf
Size: 4268 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200314/53827149/attachment-0001.pdf>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200314/53827149/attachment-0003.htm>
More information about the ntg-context
mailing list