Hi Michael,

On 15.10.09, Michael J Gruber wrote:
> I know that one, but is style.linewidth() an instance of trafo.trafo,
> canvas.clip, style.strokestyle or style.fillstyle? I tried anyways, and
> it worked, of course, because of the way attrs are handed down.

It's an instance of style.strokestyle.

On 15.10.09, Michael J Gruber wrote:
> from pyx import *
>·
> c = canvas.canvas()
> c2 = canvas.canvas()
>·
> c.stroke(path.line(0,0,0,1))
> c2.stroke(path.line(1,0,1,1))
> c2.stroke(path.line(2,0,2,1), [style.linewidth(0.2)])
>·
> c.insert(c2, [style.linewidth(0.4)])
>·
> c.stroke(path.line(3,0,3,1))
> c2.stroke(path.line(4,0,4,1))
>·
> c.writePDFfile(__file__[:-3])
>·
> How many (even long time) users will get it right?

Hey, but that should all be obvious :-)

(i) Setting PS attributes is done via the usual PS operators
encapsulated in a gsave/grestore pair. The "last" operator of course takes
precedence.

(ii) There are no copies what so ever involved, so it doesn't matter
when - i.e. before or after inserting it - you modifiy the contents
of a canvas.


> I thought the line at 2 has width 0.4 (because of the order of
> "assignments" of linewidths) and wasn't sure whether the one at 4
> would
> appear. But I remembered experimenting once with the difference
> between
> inserting a canvas, a copy of a canvas and a *deep* copy of a canvas,
> which explains this.

As I said above, there is no copy happening at all!

Best,

        Jörg


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to