Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CharsToPixels patch #69

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments
Open

CharsToPixels patch #69

GoogleCodeExporter opened this issue Mar 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Hello,
I have found that TExtObject.CharsToPixels was not 100% accurate and change it 
to this:

  Result := JSExpression('%s * %.2f', [ExtUtilTextMetrics.GetWidth('g'), Chars * 1.1]);

which I believe is more realistic. This led me to find a bug in formatting 
float values (also done in LinesToPixels and other places) which the attached 
patch fixes. This is for D2009+, it probably needs to be tweaked for other 
platforms.

P.S. The patch also contains an unrelated change, the definition of 
TExtObjectClass which is generally helpful to some and does no harm to others.

Original issue reported on code.google.com by nando.dessena on 29 Sep 2011 at 10:30

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant