ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <pragma@wxs.nl>
Subject: Re: Rotation fails in the latest beta
Date: Thu, 9 Feb 2012 17:34:39 +0100	[thread overview]
Message-ID: <F395BB20-9685-4163-AB3E-E92A8D369587@googlemail.com> (raw)
In-Reply-To: <20120209170935.06a5f574@homerow>


Am 09.02.2012 um 17:09 schrieb Marco:

> On 2012-02-09 Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
> 
>> pack-rul.mkiv:
>> 
>> \def\pack_framed_start_orientation
>> - {\ifcase\p_framed_orientation\else
>> + {\ifcase\p_framed_orientation
> 
> Thanks for the quick fix.
> 
> Why do orientation and rotate produce different results? Example:
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \startbuffer [te]
> 	\starttext
> 		\framed[width=5cm,height=2cm,rulethickness=3pt,align=right]{\tfd Foo}
> 	\stoptext
> \stopbuffer
> 
> \starttext
> 	\startplacefigure [title=Orientation]
> 		\externalfigure [te] [orientation=90, frame=on]
> 	\stopplacefigure
> 
> 	\startplacefigure [title=Rotation]
> 		\rotate[rotation=90]{\externalfigure [te]}
> 	\stopplacefigure
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


I guess it comes from this part in pack-rul.mkiv, when you rotate the box by 90 or 270 degrees
context switches the width and height of the framed box (which is also used by \externalfigure)
but as you can see he does this first in \pack_framed_start_orientation and a second time in
\pack_framed_stop_orientation_odd.

\def\pack_framed_start_orientation
  {\ifcase\p_framed_orientation
     \let\pack_framed_stop_orientation\relax
   \else
     \scratchcounter\p_framed_orientation % weird .. why
     \divide\scratchcounter\plustwo
     \ifodd\scratchcounter
       \swapmacros\framedwidth\framedheight
       \swapmacros\localwidth\localheight
       \swapdimens\d_framed_height\d_framed_width
       \let\pack_framed_stop_orientation\pack_framed_stop_orientation_odd
     \else
       \let\pack_framed_stop_orientation\pack_framed_stop_orientation_even
     \fi
   \fi}

% why are the dimensions swapped again, this was already done above

\def\pack_framed_stop_orientation_odd
  {\swapmacros\framedwidth\framedheight
   \swapmacros\localwidth\localheight
   \swapdimens\d_framed_height\d_framed_width
   \pack_framed_stop_orientation_even}

Wolfgang
___________________________________________________________________________________
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	other threads:[~2012-02-09 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 14:53 Marco
2012-02-09 15:11 ` Wolfgang Schuster
2012-02-09 16:09   ` Marco
2012-02-09 16:34     ` Wolfgang Schuster [this message]
2012-02-09 18:25       ` Hans Hagen
2012-02-09 18:46         ` Marco
2012-02-09 18:54           ` Wolfgang Schuster
2012-02-09 19:07             ` Marco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F395BB20-9685-4163-AB3E-E92A8D369587@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).