|
From: Joerg L. <jo...@us...> - 2002-02-26 15:30:04
|
On 26.02.02, Andre Wobst wrote:
> (Next time it would be better to start a new thread for those things.
> Otherwise we'll end up in just one subject line with 100 postings ...)
I like long threads, which become more and more offtopic :))
> > How about
> > dropping the unit in canvas, i.e. the late evaluation of units?
> > I'm becoming more and more in favour of it, since I don't like:
> >
> > - passing a canvas for the intersection of bezier curves
> > - passing a canvas for tranforming a arct into a bezier curves
>
> The same for the h-size problem in tex.py.
I know. So we have three, and maybe even more in the future...
> One problem on dropping that out of the canvas is, that we then do not
> know anymore how to change the unit, which we use, if we just write
> plain numbers. If I see through it correctly, that was the reason for
> the marriage of the canvas and the units and therefore for the late
> evaluation. What about just saying t.text(1,2,"bla"). In what units
> are these 1 and 2 are measured? (Same for paths, like lineto and
> thatever else ...)
Yes, that's true. But maybe we can use a hack, which stores the base
unit globally (as a static property of the unit class). Isn't
something like that possible in Python 2.2? All the routines would
then do something like
class moveto(pathel):
def __init__(self, x, y):
self.x = unit.unit.pt(x)
self.y = unit.unit.pt(y)
unit.unit.pt would then be a class method (I don't remember the
correct name), which knows the default unit. With such a solution
we could also retain the present semantics, for instance:
moveto("0.5 v mm", 3)
I haven't tried it yet, but probably it works.
Joerg
|