Tuesday, March 25, 2003 Hans Hagen wrote:
>>The problem is still that I cannot separate the behaviour at the
>>end of the background from the behaviour at a split. What I'm
>>looking for is something like this:

HH> guess what, this time your demands for features are fulfilled on forehand!

HH> there is an array available

HH>    multilocs[...]

HH> 1 = top
HH> 2 = mid
HH> 3 = bottom

HH> shape; this is how i could handle the example in details with different
HH> shades per kind of frame

Almost perfect! Only a few things need refining:

(1) "top" is also used when there is no split; it should be
possible to detect the "no-split" situation (multilocs=0?)

(2) I still need a to find a way to make only certain corners
rounded, but I guess that's just a matter of MetaPosting a little.

Up to now, I came up with the following:

\starttext

\setupcolors[state=start]

\definetextbackground[gb][state=start]

\startuseMPgraphic{mpos:par:columnset}
   path p, q;
   for i := 1 upto nofmultipars :
     p := counterclockwise simplified multipars[i] leftenlarged 5pt rightenlarged 5pt ;
     if multilocs[i] = 1 :
       q := p topenlarged 5pt ;
       fill q withcolor green ;
       draw topboundary q withcolor red ;
       draw leftboundary q withcolor red ;
       draw rightboundary q withcolor red ;
     elseif multilocs[i] = 2 :
       q := p ;
       fill q withcolor green ;
       draw leftboundary q withcolor red ;
       draw rightboundary q withcolor red ;
     else:
       q := p bottomenlarged 5pt;
       fill q withcolor green ;
       draw bottomboundary q withcolor red ;
       draw leftboundary q withcolor red ;
       draw rightboundary q withcolor red ;
     fi
   endfor ;
\stopuseMPgraphic

\starttextbackground[gb]
\input tufte
\stoptextbackground

\blank[2*big]

\starttextbackground[gb]
\dorecurse{10}{\input tufte \par}
\stoptextbackground
\blank \input tufte

\stoptext

As you can see, the first background doesn't split and behaves
like multilocs=1, while one would wish it to behave differently.

-- 
Giuseppe "Oblomov" Bilotta

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to