Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2015-11-18 19:54:13 +0000
committerNiraj Modi2015-11-24 07:53:36 +0000
commit9e76f3ed668a6862d407d4ac586dcbb28cbaef59 (patch)
tree571cb05845d4877a3745b14a3d33a51f5551f989
parenteec69d54257dd905a06e43fb705f40df9326414e (diff)
downloadeclipse.platform.swt-9e76f3ed668a6862d407d4ac586dcbb28cbaef59.tar.gz
eclipse.platform.swt-9e76f3ed668a6862d407d4ac586dcbb28cbaef59.tar.xz
eclipse.platform.swt-9e76f3ed668a6862d407d4ac586dcbb28cbaef59.zip
Bug 408833 - StyledText hides last character of wrapped line
Fix line-break algorithm in the case where a soft-break or line-break cannot be found to avoid breaking a run at the first character, unless it's the only run available. Change-Id: I3e69f380d061d2bb1c8bfaa5427c6b751d9dbe5f Signed-Off-By: Brian de Alwis <bsd@mt.ca>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index 556a71393b..03dee9fc1a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -333,8 +333,13 @@ void computeRuns (GC gc) {
if (wrapEntireRun) {
run = allRuns[--i];
start = run.length;
- } else if (start <= 0 && i == lineStart) {
- if (lineWidth == wrapWidth && firstIndice > 0) {
+ } else if (start <= 0 && i == lineStart) {
+ /*
+ * No soft-break or line-feed found. Avoid breaking a run at
+ * the first character (firstStart == 0) unless it's the
+ * only run available (firstIndice == lineStart). See bug 408833.
+ */
+ if (firstStart == 0 && firstIndice > lineStart) {
i = firstIndice - 1;
run = allRuns[i];
start = run.length;

Back to the top