Project: SWT
Bug 269305 Path#addString baseline aligning
Reported: 2009-03-18 20:20:59 | Status: resolved fixed

When adding a string to a Path at a given coordinate (with Path#addString()), normally, the text's baseline is aligned to the same position as if it was drawn at the given location. Under OS X Cocoa however, the text's baseline is aligned to the bottom of the text's bounding box (calculated with TextUtilities#getStringExtents()). This is strange behaviour, and makes it impossible to calculate the text's relative baseline in the Path or to align it to a given location.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLayoutManager.java bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java