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.htmlThere 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?).
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)])Maybe this is too much in terms of user friendliness, but I clearly like this solution most.
I found no clean way to set an overall default line width which is why Idid it that way. Assigning to style._defaultlinewidth (and ..._pt) is something you should not try at home.
Hmm. It's hardcoded in style.py: _defaultlinewidth = 0.02 * unit.w_cmThe intention of the width units is to be able to scale all line width by unit.set(wscale=...), however, the factor need to set the defaultlinewidth to, say, 1pt is nontrivial. Maybe we should make it possible to set the default linewidth without altering the wscale at all. 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).
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. Best, André -- by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim / \ \ / ) [email protected], http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ 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
