Without doing any actual testing:
The vertical alignment stuff looks right to me.
Horizontal alignment is suspicious. If the world transform rotates the text 90 degrees, DrawTextW can't be getting enough information to center the text. Then again, I'm not sure if rotation works properly with GdipDrawString in general. I'd write a test program for rotated text.
I would probably send this as a series of 2 patches with vertical alignment first.
In spite Paul Vriens' comments, don't change the formatting of code you're not changing. I guess the existing if's are already inconsistent enough that you can get away with either style (and that might actually be my fault).
Vincent Povirk
On Tue, Jun 2, 2009 at 7:12 AM, Stephan Rosekermos@somrek.net wrote:
- Adds support for aligning a string inside the given bounding rectangle
for GdipDrawString. Both vertical and horizontal alignments implemented.
- Fixed code formatting issues (tabs / spaces, location of braces) to be
consistent with existing code.