Hi,
On 15.10.09, André Wobst wrote:
> Am 15.10.2009 um 10:36 schrieb Michael J Gruber:
>
>> Alan G Isaac venit, vidit, dixit 15.10.2009 02:26:
>>> On 10/14/2009 6:22 AM, Michael J Gruber wrote:
>>>> c = canvas.canvas([style.linewidth(1)])
>>>
>>> So I had wondered about this and did
>>> not understand the documentation.
>>>
>>> If one applies a line style to a canvas, I take
>>> it that it becomes the default for all stroke operations
>>> (by that canvas), including draw operations?
>>
>> It seems so ;)
>> It's not documented (online draw style is), but it works that way.
>
> See canvas constructor at http://pyx.sourceforge.net/manual/node17.html
>
> There also is (or was) a canvas set method. However, I consider this a
> bad design and we are about to remove that (am I right, Jörg?).
Yes, we wanted to get rid of this. AFAIR we mostly kept it for technical
reasons.
> Its also questionable, whether the canvas constructor attrs-field is a
> good design decision. I remember having argued against it. Anyway, it is
> likely to stay(?). To my mind, the cleanest way of setting attributes is
> while inserting a canvas in another canvas.
>
> c = canvas()
> c2 = canvas()
> c.insert(c2, [style.linewidth(1)])
I also don't like the attrs argument of the canvas class too much, but
the solution with two canvases is too complicated.
Anyway, I have to say that in general you should use
unit.set(wscale=...) instead of setting a default linewidth, since then
also linewidth.thick, etc., work as wanted. As André has pointed out,
though, finding the right scaling factor for a given line-width is
non-trivial, although possible. Btw, that would be an argument for a
more natural base for the linewidth.
> However, I don't consider this to be that important. Other things
> clearly are, like doing a new release this year (which is a new year's
> pledge of mine, and I still hope to get it done).
Yes :-)
>>> PS Btw, it is great to be able to sum(mypaths,path()),
>>> but might it be worth defining mypath+0 to be mypath
>>> so we can just sum(mypaths)? Not sure this is a good
>>> idea but thought I'd throw it out there.
>
>
> hmmm ... -0 ... I don't like it.
Same for me.
Cheers,
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