ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Troubles with backgrounds in bTABLE
@ 2010-08-04  6:57 Willi Egger
  2010-08-04  7:32 ` Peter Münster
  2010-08-04  7:45 ` Peter Rolf
  0 siblings, 2 replies; 5+ messages in thread
From: Willi Egger @ 2010-08-04  6:57 UTC (permalink / raw)
  To: NTG-Context ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

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.

Please refer to the attached test file.


Using:
This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
ConTeXt  ver: 2010.08.04 00:37 MKII  fmt: 2010.8.4  int: english/english

Kind regards

Willi

[-- Attachment #2: test-background.tex --]
[-- Type: application/octet-stream, Size: 824 bytes --]


\startuniqueMPgraphic{Topline}
	path p,q;
	p := unitsquare xscaled \overlaywidth yscaled \overlayheight;
	draw urcorner p -- ulcorner p withpen pencircle scaled 2pt;
\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]{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

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Troubles with backgrounds in bTABLE
  2010-08-04  6:57 Troubles with backgrounds in bTABLE Willi Egger
@ 2010-08-04  7:32 ` Peter Münster
  2010-08-04  7:38   ` Willi Egger
  2010-08-04  7:45 ` Peter Rolf
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Münster @ 2010-08-04  7:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Aug 04 2010, Willi Egger wrote:

> Please refer to the attached test file.

Hello Willi,

Here some workaround:

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

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Troubles with backgrounds in bTABLE
  2010-08-04  7:32 ` Peter Münster
@ 2010-08-04  7:38   ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2010-08-04  7:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Peter,

thanks for this rapid reply! Though not nice, it works!

Willi 
On 4 Aug 2010, at 09:32, Peter Münster wrote:

> On Wed, Aug 04 2010, Willi Egger wrote:
> 
>> Please refer to the attached test file.
> 
> Hello Willi,
> 
> Here some workaround:
> 
> \startuniqueMPgraphic{Topline}
> 	path p,q;
> 	p := unitsquare xscaled \overlaywidth yscaled \overlayheight;
> 	draw urcorner p -- ulcorner p withpen pencircle scaled 2pt;
> 	draw lrcorner p -- lrcorner p withpen pencircle scaled 0pt;
> \stopuniqueMPgraphic
> 
> Cheers, Peter
> 
> -- 
> Contact information: http://pmrb.free.fr/contact/
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Troubles with backgrounds in bTABLE
  2010-08-04  6:57 Troubles with backgrounds in bTABLE Willi Egger
  2010-08-04  7:32 ` Peter Münster
@ 2010-08-04  7:45 ` Peter Rolf
  2010-08-04  8:27   ` Willi Egger
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Rolf @ 2010-08-04  7:45 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

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

[-- Attachment #2: test-background.tex --]
[-- Type: text/plain, Size: 940 bytes --]

\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

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Troubles with backgrounds in bTABLE
  2010-08-04  7:45 ` Peter Rolf
@ 2010-08-04  8:27   ` Willi Egger
  0 siblings, 0 replies; 5+ messages in thread
From: Willi Egger @ 2010-08-04  8:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Peter,

thanks for your explanation. Hm, that also makes clear why the diagonal works without setting the bounding box. 

Willi
On 4 Aug 2010, at 09:45, Peter Rolf wrote:

> 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
> <test-background.tex>___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-04  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-04  6:57 Troubles with backgrounds in bTABLE Willi Egger
2010-08-04  7:32 ` Peter Münster
2010-08-04  7:38   ` Willi Egger
2010-08-04  7:45 ` Peter Rolf
2010-08-04  8:27   ` Willi Egger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).