![](https://secure.gravatar.com/avatar/68efba1b4239dc861d0258f62927557c.jpg?s=120&d=mm&r=g)
Given rectangles with text: \starttext Before:\\ \startMPcode draw unitsquare xscaled 2cm yscaled 1cm; \stopMPcode \\ After:\\ \startMPcode for i=0 upto 1: draw unitsquare scaled 1cm xshifted i*cm; endfor; \stopMPcode \stoptext How can a line be drawn connecting the right edges of the rectangles? I have played with: \startuniqueMPgraphic{line} path a; a:=(0,0)--(0,3cm); draw a withpen pencircle scaled 3pt withcolor green; \stopuniqueMPgraphic \defineoverlay[line][{\uniqueMPgraphic{line}}] and using it in \framed, but placing the line correctly is elusive.
![](https://secure.gravatar.com/avatar/44ca9eda7aaa681c0e3b3e90125c56b0.jpg?s=120&d=mm&r=g)
Am 22.11.2014 um 21:32 schrieb John Kitzmiller:
Given rectangles with text:
\starttext Before:\\ \startMPcode draw unitsquare xscaled 2cm yscaled 1cm; \stopMPcode \\ After:\\ \startMPcode for i=0 upto 1: draw unitsquare scaled 1cm xshifted i*cm; endfor; \stopMPcode \stoptext
How can a line be drawn connecting the right edges of the rectangles? I have played with:
\startuniqueMPgraphic{line} path a; a:=(0,0)--(0,3cm); draw a withpen pencircle scaled 3pt withcolor green; \stopuniqueMPgraphic
\defineoverlay[line][{\uniqueMPgraphic{line}}]
and using it in \framed, but placing the line correctly is elusive.
Just a quick and dirty solution. The trick is to draw the extra line as part of the graphic and then fake the boundingbox. This is also limited to a few centimeter, objects are cut off after you reach that 'invisible' border around the boundingbox. I would use uniqueMPgraphic with proper parameters for the graphics. Using overlays is also possible (urcorner OverlayBox), but I see no real need or benefit to do so. HTH, Peter
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Am 22.11.2014 um 21:32 schrieb John Kitzmiller
: Given rectangles with text:
\starttext Before:\\ \startMPcode draw unitsquare xscaled 2cm yscaled 1cm; \stopMPcode \\ After:\\ \startMPcode for i=0 upto 1: draw unitsquare scaled 1cm xshifted i*cm; endfor; \stopMPcode \stoptext
How can a line be drawn connecting the right edges of the rectangles? I have played with:
\startuniqueMPgraphic{line} path a; a:=(0,0)--(0,3cm); draw a withpen pencircle scaled 3pt withcolor green; \stopuniqueMPgraphic
\defineoverlay[line][{\uniqueMPgraphic{line}}]
and using it in \framed, but placing the line correctly is elusive.
Look at chapter 5 in the metafun manual. Wolfgang
participants (3)
-
John Kitzmiller
-
Peter Rolf
-
Wolfgang Schuster