deco.text() suggestion
commitfd39eccf27151d8586c9707ce9c6a12c28b7c00e
authorMichael J Gruber <michaeljgruber@users.sourceforge.net>
Mon, 13 Mar 2006 15:12:26 +0000 (13 16:12 +0100)
committerMichael J Gruber <michaeljgruber@users.sourceforge.net>
Mon, 13 Mar 2006 15:12:26 +0000 (13 16:12 +0100)
treeaaf30e070837dca5d032c70fde30d17c085fad49
parent6b6a2a5b70277d8c3fdea8419ac6bfcf7f970de6
deco.text() suggestion

deco.text() has an angle attribute specifying the direction (with
respect to the coordinate system) in which to shift the text from the
point on the path. When annotating curves with multiple labels at points
with different slopes I find it more convenient to shift text along the
normal to the curve. I suggest making the default of the angle argument
"None" instead of 0, "None" meaning "use the direction of the normal".

An alternative would be to measure the angle with respect to the tangent
(maybe toggled by a boolean option "usetangent"), although I imagine
only ever using 90 and 270 degrees then.

I also noticed that deco.text() uses "relarclenpos" where deco.arrow()
uses "pos" with the same meaning. A common name would be useful.

I attached a deco.ttext() method implementing the changed default
behaviour (None=use normal). Text decorators are shifted perpendicularly
to the right of the path (to the left if textdist<0).
As it is it's meant to go into deco.py (uses the same imports etc.). I'd
be happy to provide a diff once I know whether deco.ttext() is supposed
to substitute the current deco.text(), complement it or just live in my
own module tree ;)
pyx/deco.py