[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Demonstration of missing characters on end of string
From: |
Alexander Malmberg |
Subject: |
Re: Demonstration of missing characters on end of string |
Date: |
Fri, 11 Jul 2003 03:35:53 +0200 |
Pete French wrote:
> Going bck to the converastions of a week or so ago - I have just noticed
> something which reliably reproduces the "missing characters on the end of a
> string" effect.
[snip]
Thanks! I was able to reproduce this, but only with some fonts. Turned
out to be a problem with finite precision arithmetic. NSStringDrawing
will use a really large text container to size text, and since the
string was right aligned, the extents were 1e8-~80 to 1e8. Subtracting
to get the width caused cancellation and loss of a bit of accuracy.
Thus, with the right font and string, the given size, passed on to
-drawRect: by the caller, would be too small, and the last character
would be clipped.
I've adjusted the "really large" sizes so that things are accurate to
whole points. Fixed in cvs (in this case, at least).
- Alexander Malmberg