diff options
author | Felipe Heidrich <fheidric> | 2009-10-29 20:31:53 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2009-10-29 20:31:53 +0000 |
commit | a461e8c91db078d6ca6c4d68c04887c5fe3d1e96 (patch) | |
tree | 486ed857c1896e88d38276498c6a41b3d9e50640 | |
parent | 9f2c32647e2c25d8ed6d40d17f76a2c5e36e008e (diff) | |
download | eclipse.platform.swt-a461e8c91db078d6ca6c4d68c04887c5fe3d1e96.tar.gz eclipse.platform.swt-a461e8c91db078d6ca6c4d68c04887c5fe3d1e96.tar.xz eclipse.platform.swt-a461e8c91db078d6ca6c4d68c04887c5fe3d1e96.zip |
Bug 277438 - Korean Input text flickers in StyledText widget in case the sentence exceeds a row. (3.5.2 backport)
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 50e1587b2e..038430f582 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -1648,6 +1648,7 @@ static int checkStyle(int style) { * deleted lines. */ void claimBottomFreeSpace() { + if (ime.getCompositionOffset() != -1) return; if (isFixedLineHeight()) { int newVerticalOffset = Math.max(0, renderer.getHeight() - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { @@ -3616,7 +3617,7 @@ Rectangle getBoundsAtOffset(int offset) { } else { bounds = new Rectangle (0, 0, 0, renderer.getLineHeight()); } - if (offset == caretOffset) { + if (offset == caretOffset && !wordWrap) { int lineEnd = lineOffset + line.length(); if (offset == lineEnd) { bounds.width += getCaretWidth(); @@ -5241,7 +5242,7 @@ int getCaretLine() { } int getWrapWidth () { if (wordWrap && !isSingleLine()) { - int width = clientAreaWidth - leftMargin - rightMargin - getCaretWidth(); + int width = clientAreaWidth - leftMargin - rightMargin; return width > 0 ? width : 1; } return -1; @@ -5692,7 +5693,7 @@ void handleCompositionChanged(Event event) { caretDirection = SWT.NULL; } else { content.replaceTextRange(start, end - start, text); - setCaretOffset(ime.getCaretOffset(), SWT.DEFAULT); + int alignment = SWT.DEFAULT; if (ime.getWideCaret()) { start = ime.getCompositionOffset(); int lineIndex = getCaretLine(); @@ -5700,7 +5701,9 @@ void handleCompositionChanged(Event event) { TextLayout layout = renderer.getTextLayout(lineIndex); caretWidth = layout.getBounds(start - lineOffset, start + length - 1 - lineOffset).width; renderer.disposeTextLayout(layout); + alignment = OFFSET_LEADING; } + setCaretOffset(ime.getCaretOffset(), alignment); } showCaret(); } |