Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2011-09-23 13:06:23 -0400
committerFelipe Heidrich2011-12-02 14:47:34 -0500
commit68fa141ccaedf214cdcdd7723012014094057aa9 (patch)
tree41b30b993efbc4bbdf10162869edcb11760fa1e9
parent250044d82ad6b43ae24b90d2ffa55f118cb507d3 (diff)
downloadeclipse.platform.swt-68fa141ccaedf214cdcdd7723012014094057aa9.tar.gz
eclipse.platform.swt-68fa141ccaedf214cdcdd7723012014094057aa9.tar.xz
eclipse.platform.swt-68fa141ccaedf214cdcdd7723012014094057aa9.zip
Bug 358188 - Horizontal alignment in StyledText does not work for SWT.SINGLE
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
index 9aaba2f07a..c4478bb587 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
@@ -156,15 +156,17 @@ void computeRuns() {
//TODO ascend descent wrap
NSMutableParagraphStyle paragraph = (NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
int align = OS.NSLeftTextAlignment;
- if (justify) {
- align = OS.NSJustifiedTextAlignment;
- } else {
- switch (alignment) {
- case SWT.CENTER:
- align = OS.NSCenterTextAlignment;
- break;
- case SWT.RIGHT:
- align = OS.NSRightTextAlignment;
+ if (wrapWidth != -1) {
+ if (justify) {
+ align = OS.NSJustifiedTextAlignment;
+ } else {
+ switch (alignment) {
+ case SWT.CENTER:
+ align = OS.NSCenterTextAlignment;
+ break;
+ case SWT.RIGHT:
+ align = OS.NSRightTextAlignment;
+ }
}
}
if ((orientation & SWT.RIGHT_TO_LEFT) != 0) {

Back to the top