![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 2/17/2021 10:26 PM, Wolfgang Schuster wrote:
Fabrice Couvreur schrieb am 17.02.2021 um 18:40:
Hi,The code works, but is it possible to make it shorter ? Thank you Fabrice
\startuseMPgraphic{DiagonalRule} rulethickness := \frameddimension{rulethickness};
drawoptions( withpen pencircle scaled rulethickness withcolor \MPcolor{\framedparameter{framecolor}});
pair leftcorner, rightcorner, Leftcorner, Rightcorner; leftcorner := (rulethickness, \overlayheight-rulethickness); rightcorner := (\overlaywidth-rulethickness, rulethickness); Leftcorner := ( rulethickness, rulethickness); Rightcorner := (\overlaywidth-rulethickness,\overlayheight-rulethickness);
draw leftcorner -- rightcorner; draw Leftcorner -- Rightcorner; \stopuseMPgraphic
\startuseMPgraphic{DiagonalRule} drawoptions( withpen pencircle scaled OverlayLineWidth withcolor OverlayLineColor );
draw ulcorner OverlayBox -- lrcorner OverlayBox ; draw llcorner OverlayBox -- urcorner OverlayBox ; \stopuseMPgraphic Often this also works:
\startuseMPgraphic{DiagonalRule} draw image ( draw ulcorner OverlayBox -- lrcorner OverlayBox ; draw llcorner OverlayBox -- urcorner OverlayBox ; ) withpen pencircle scaled OverlayLineWidth withcolor OverlayLineColor ; \stopuseMPgraphic ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------