* overlay problem (beta 31.12.2019)
@ 2020-01-02 16:00 Peter Rolf
2020-01-02 18:07 ` Hans Hagen
0 siblings, 1 reply; 2+ messages in thread
From: Peter Rolf @ 2020-01-02 16:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Hans
There is a small problem with overlays.
%-----
\starttext
\defineoverlay[foo][{\blackrule[color=black,width=20mm,height=20mm]}]%
\framed[background=foo,strut=no,offset=overlay]%{\blackrule[color=white,width=16mm,height=16mm]}
\stoptext
%-----
The inner square should be centered.
Peter
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: overlay problem (beta 31.12.2019)
2020-01-02 16:00 overlay problem (beta 31.12.2019) Peter Rolf
@ 2020-01-02 18:07 ` Hans Hagen
0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2020-01-02 18:07 UTC (permalink / raw)
To: mailing list for ConTeXt users, Peter Rolf
On 1/2/2020 5:00 PM, Peter Rolf wrote:
> Hi Hans
>
> There is a small problem with overlays.
>
> %-----
> \starttext
> \defineoverlay[foo][{\blackrule[color=black,width=20mm,height=20mm]}]%
> \framed[background=foo,strut=no,offset=overlay]%{\blackrule[color=white,width=16mm,height=16mm]}
> \stoptext
> %-----
put this in cont-new.mkiv :
\ifcase\contextlmtxmode \else
\unexpanded\def\executedefinedoverlay#1#2%
{\bgroup
\setlayoutcomponentattribute{\v!overlay:#1}%
\setbox\scratchbox\hbox
\layoutcomponentboxattribute{\the\everyoverlay#2}%
\boxxoffset\scratchbox-.5\dimexpr\wd\scratchbox-\d_framed_target_wd\relax
\boxyoffset\scratchbox-.5\dimexpr\ht\scratchbox-\d_framed_target_ht+\d_framed_target_dp\relax
\wd\scratchbox\d_framed_target_wd
\ht\scratchbox\d_framed_target_ht
\dp\scratchbox\d_framed_target_dp
\box\scratchbox
\egroup}
\fi
no updates today and tomorrow
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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-02 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 16:00 overlay problem (beta 31.12.2019) Peter Rolf
2020-01-02 18:07 ` Hans Hagen
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).