ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Tobias Columbus <tobias.columbus@gmail.com>
To: ntg-context@ntg.nl
Subject: clipping in metafun has weird side effects
Date: Thu, 30 Oct 2014 20:56:34 +0100	[thread overview]
Message-ID: <20141030195634.GA2960@gmail.com> (raw)

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

Dear all,

I stumbled upon some very weird behaviour of clipping in metafun/context. When I
add some clipped pictures to currentpicture and draw something dashed, some
subsequent lines will also be drawn dashed.

This behaviour only shows up with context but not with mptopdf or mpost. I
attached a minimal example and the corresponding output of context and mptopdf.

I tried context versions 2014.05.21 22:04 and 2014.10.29 17:47, but the result
is the same in both.

Tobias




-- 

[-- Attachment #2: mwe.mp --]
[-- Type: text/plain, Size: 929 bytes --]


vardef mycircle =
  save c ; picture c ; c := nullpicture ;
  addto c contour fullcircle scaled 2mm ;
  c
enddef ;

def a expr p =
  path _p_ ; _p_ := p ;
  a_impl
enddef ;

def a_impl text t =
  begingroup
    save c ; picture c ; c := mycircle ;
    clip c to bbox c scaled 0.5 ;
    addto currentpicture also c t ;
    addto currentpicture doublepath _p_ t ;
  endgroup
enddef ;

def b expr p =
  path _p_ ; _p_ := p ;
  b_impl
enddef ;

def b_impl text t =
  begingroup
    save c; picture c ; c := mycircle ;
    addto currentpicture also c t ;
    addto currentpicture doublepath _p_ t ;
  endgroup
enddef ;
beginfig(1)

  a (0,0) -- (1cm,0) dashed evenly ;
  currentpicture := currentpicture shifted (2cm,0) ;
  a (0,0) -- (1cm,0) ;

  currentpicture := currentpicture shifted (-2cm, 0.5cm );

  b (0,0) -- (1cm,0) dashed evenly ;
  currentpicture := currentpicture shifted (2cm,0) ;
  b (0,0) -- (1cm,0) ;

endfig ;
end

[-- Attachment #3: mwe-context.pdf --]
[-- Type: application/pdf, Size: 3773 bytes --]

[-- Attachment #4: mwe-mptopdf.pdf --]
[-- Type: application/pdf, Size: 1843 bytes --]

[-- Attachment #5: Type: text/plain, Size: 485 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
___________________________________________________________________________________

             reply	other threads:[~2014-10-30 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 19:56 Tobias Columbus [this message]
2014-10-31  8:58 ` Tobias Columbus
2014-10-31  9:05   ` Hans Hagen
2014-10-31  9:15     ` Tobias Columbus
2014-10-31 11:10       ` Hans Hagen
2014-10-31 11:22       ` Hans Hagen
2014-10-31 12:33         ` Tobias Columbus
2014-11-02 10:29           ` Hans Hagen
2014-11-02 12:09             ` Tobias Columbus

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=20141030195634.GA2960@gmail.com \
    --to=tobias.columbus@gmail.com \
    --cc=ntg-context@ntg.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).