Hi Willi,

Am 04.08.2010 08:57, schrieb Willi Egger:
> Hi all,
> 
> I need to use the background mechanism to draw a thicker line in a 
> bTABLE...eTABLE setup together with MKII.
> It looks like that there is a bug somewhere in this. I am unable to draw the 
> line at the top of the cell. However it is possible to draw a diagonal 
> through the cel. I think that the problem is related to the background 
> mechanism in general, because the problem is also present when using the 
> background mechanism in framed. The behavior is identical in MKII en MKIV.
> I updated this morning to the latest version of Context, the bug is there as 
> it was in a version ca 1 month old.
>
No bug, only the bounding box. The relative position of a graphic does
not count any longer, if the graphic leaves MP.
For example: drawing a fullcircle/unitcircle results in the same
graphic, although they have a different center point. Only the final
boundingbox is counting here (equal in this case).
In your example the boundingbox has the size (OverlayWidth,2pt) or
(OverlayWidth+2pt,2p) if you ignore the linewidth. So you need a manual
boundingbox setup, as in the attached example. The Topline does not
cross the borders of the OverlayBox (donno if this is wanted, but easy
to change).

Best wishes,  Peter
\setupcolors[state=start]


\startuniqueMPgraphic{Topline}
        draw (1pt,OverlayHeight-1pt)--(OverlayWidth-1pt,OverlayHeight-1pt)
        withpen pencircle scaled 2pt;
        setbounds currentpicture to OverlayBox;
\stopuniqueMPgraphic


\startuniqueMPgraphic{Diagonal}
        path p,q;
        p := unitsquare xscaled \overlaywidth yscaled \overlayheight;
        draw llcorner p -- urcorner p withpen pencircle scaled 2pt;
\stopuniqueMPgraphic

\defineoverlay[Topline][\useMPgraphic{Topline}]
\defineoverlay[Diagonal][\useMPgraphic{Diagonal}]

\starttext
\bTABLE
        \setupTABLE[r][1][background=Topline]
\bTR
   \bTD Test\ \eTD      
\eTR 
\bTR
   \bTD Test\ \eTD      
\eTR
\eTABLE

\blank
\framed[background=Topline,framecolor=red]{test}
\blank

\bTABLE
        \setupTABLE[r][1][background=Diagonal]
\bTR
   \bTD Test\ \eTD      
\eTR 
\bTR
   \bTD Test\ \eTD      
\eTR
\eTABLE

\blank
\framed[background=Diagonal]{test}
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to