From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11822 Path: main.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re[2]: Backgrounds Date: Wed, 9 Apr 2003 18:57:18 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <122893905.20030409185718@iol.it> References: <5.1.0.14.1.20030325094633.031a8c80@server-1> <5.1.0.14.1.20030325094633.031a8c80@server-1> <5.1.0.14.1.20030325131938.01d9af40@server-1> <9619582618.20030325153623@iol.it> <871y0biuyd.fsf@gundla.ch> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049907708 30772 80.91.224.249 (9 Apr 2003 17:01:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 9 Apr 2003 17:01:48 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Wed Apr 09 19:01:46 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 193Ivu-0007vP-00 for ; Wed, 09 Apr 2003 19:00:22 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 5BD4710B49; Wed, 9 Apr 2003 19:00:50 +0200 (MEST) Original-Received: from smtp0.libero.it (smtp0.libero.it [193.70.192.33]) by ref.ntg.nl (Postfix) with ESMTP id B5C3310B49 for ; Wed, 9 Apr 2003 18:57:34 +0200 (MEST) Original-Received: from OBLOMOV (151.29.141.78) by smtp0.libero.it (7.0.012) id 3E9436120000E58E for ntg-context@ntg.nl; Wed, 9 Apr 2003 18:57:34 +0200 X-Mailer: The Bat! (v1.63 Beta/7) X-Priority: 3 (Normal) Original-To: ntg-context@ntg.nl In-Reply-To: <871y0biuyd.fsf@gundla.ch> Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11822 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11822 Wednesday, April 9, 2003 Patrick Gundlach wrote: PG> Giuseppe Bilotta writes: PG> Hello Giuseppe, >> \startuseMPgraphic{mpos:par:columnset} >> path p, q; >> for i := 1 upto nofmultipars : >> p := counterclockwise simplified multipars[i] leftenlarged 5pt >> rightenlarged 5pt ; PG> why did you use "counterclockwise simplified..." ? What is this? I used that to make sure that p didn't have extra points (simplified) and went in a specific direction (counterclockwise); anyway, I rewrote my code: === \starttext \setupcolors[state=start] \definetextbackground[gb][state=start] \startuseMPgraphic{mpos:par:columnset} pair urc, ulc, llc, lrc ; % corners path urcp, ulcp, llcp, lrcp ; % paths path q ; cornerradius := 5pt ; offset := 7.5pt ; color framecolor, backgroundcolor ; pen framepen ; framecolor := red ; framepen := pensquare rotated 45 ; framethickness := 2pt ; backgroundcolor := lightgray ; for i := 1 upto nofmultipars : urc := urcorner multipars[i] + (offset, offset) ; ulc := ulcorner multipars[i] + (-offset, offset) ; llc := llcorner multipars[i] + (-offset, -offset) ; lrc := lrcorner multipars[i] + (offset, -offset) ; ulcp := quartercircle rotated 90 scaled (2*cornerradius) shifted (ulc + (cornerradius, -cornerradius)) ; urcp := quartercircle scaled (2*cornerradius) shifted (urc + (-cornerradius, -cornerradius)) ; llcp := quartercircle rotated 180 scaled (2*cornerradius) shifted (llc + (cornerradius, cornerradius)) ; lrcp := quartercircle rotated -90 scaled (2*cornerradius) shifted (lrc + (-cornerradius, cornerradius)) ; if multilocs[i] = 1 : % top q := lrc -- urcp -- ulcp -- llc ; fill q--cycle withcolor backgroundcolor ; draw q withcolor framecolor withpen framepen scaled framethickness ; elseif multilocs[i] = 2 : fill llc -- lrc -- urc -- ulc -- cycle withcolor backgroundcolor ; draw ulc -- llc withcolor framecolor withpen framepen scaled framethickness ; draw lrc -- urc withcolor framecolor withpen framepen scaled framethickness ; else: q := ulc -- llcp -- lrcp -- urc ; fill q--cycle withcolor backgroundcolor ; draw q withcolor framecolor withpen framepen scaled framethickness ; fi endfor ; \stopuseMPgraphic \starttextbackground[gb] \input tufte \stoptextbackground \blank[2*big] \starttextbackground[gb] \dorecurse{5}{\input tufte \par} \stoptextbackground \blank \input tufte \stoptext === Now the only thing we need is a way to know when the background is split and when it's not. Hans? -- Giuseppe "Oblomov" Bilotta