On Fri, Sep 13, 2002 at 09:52:07PM +0100, John Levon wrote:
> I'm not entirely sure where the bottleneck is yet (well I know that all
> the .width() enquiries are expensive, but I'm not sure how to fix it)

By having two passes when drawing, the first one only to calculate metrics,
the second one for drawing. Cache the metrics together with a flag whether
the cached values are valid. Redrawing only needs to re-compute parts of
the metrics information. Optimally, .width() only takes time when
something actually has changed inside the object for which  width() is
called.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to