Limit randomizations of boxes by the minimum dimension.
[matthijs/master-project/report.git] / Utils / Lambda.tex
index b300b3524a10921c845c35d27bc97283a04ffbb8..5efe1df0f0ad9aaeed8a510709e6ab490b212eeb 100644 (file)
@@ -27,7 +27,7 @@ path a, b;
 % Create a rectangle of the full size
 a := unitsquare xyscaled(\overlaywidth,\overlayheight);
 % Randomize it a bit
-b := a randomized (\overlaywidth / 25) ;
+b := a randomized (min(\overlayheight, \overlaywidth) / 25) ;
 % And draw it
 drawoptions (withpen pencircle scaled .75mm withcolor black) ;
 draw b; 
@@ -70,3 +70,10 @@ draw b;
   % Reset the typing options
   \setuptyping[option=none,style=\tttf]
 }
+
+% Display a useMPgraphic in a pretty box
+\define[1]\boxedgraphic{
+  \startboxed
+  \useMPgraphic{#1}
+  \stopboxed
+}