Hi,

Thanks a lot Hans for the fix and suggestion for simplifying the code!
I confirm that it works perfectly now.

Cheers,
Florent

Le sam. 6 déc. 2025 à 16:05, Hans Hagen via ntg-context <[email protected]>
a écrit :

> On 12/6/2025 3:18 PM, Florent Michel wrote:
> > Hi,
> >
> > Thank you Hans for the new upload!
> >
> > I just tried updating and encountered an unexpected behaviour with
> > overlaying a MetaPost graphic. The example below shows the issue:
> > ______________________________________________
> > \startuseMPgraphic{CodeOverlay}
> > z1 = (0, 0) ;
> > z2 = (OverlayWidth, 0) ;
> > z3 = (OverlayWidth, OverlayHeight) ;
> > z4 = (0, OverlayHeight) ;
> >
> > path p ;
> > p = (z1--z2--z3--z4--cycle) cornered .5cm ;
> > draw p;
> >
> > setbounds currentpicture to OverlayBox ;
> > \stopuseMPgraphic
> >
> > \defineoverlay[CodeOverlay][\useMPgraphic{CodeOverlay}]
> >
> > \definetyping
> >      [Code]
> >      [strip=yes,
> >      before={\startframedtext[width=\makeupwidth,
> >                               offset=0.5em,
> >                               frame=none,
> >                               background=CodeOverlay,
> >                               ]},
> >      after={\stopframedtext}]
> >
> > \starttext
> >      \startCode
> >          test
> >          test2
> >      \stopCode
> > \stoptext
> > _________________________________________________
> >
> > With the previous version (2025.11.24 17:55), the output looks correct;
> > but with the new version the frame does not seem to appear.
> > (Interestingly, it does appear if I delete `cornered .5cm`.)
> >
> > Was there a change in how `cornered`  works?
>
> indeed, but line 2925 in mp-tool.mpxl is missing a fi
>
>      endfor if cycle p : cycle else : nocycle fi)
>
> so you can fix that. You mp can be simplified:
>
> \startuseMPgraphic{CodeOverlay}
>      draw OverlayBox cornered .5cm ;
> \stopuseMPgraphic
>
> and the tex code can be:
>
>      before={\startframedtext[width=\makeupwidth,
>                               offset=0.5em,
>                              corner=round,
>                               ]},
>
> (also a bit more efficient corners)
>
> Hans
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : [email protected] /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to