summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2010-11-08 19:22:59 +0000
committerFelipe Heidrich <fheidric>2010-11-08 19:22:59 +0000
commit44faa8d35b72980c9485f058bf1df97ca1ce6922 (patch)
tree34978a4ca6c7476e23452278029c0ad378594af8
parent466951fbac097e49cbe576be65c93eae27c8dbbd (diff)
downloadeclipse.platform.swt-44faa8d35b72980c9485f058bf1df97ca1ce6922.tar.gz
eclipse.platform.swt-44faa8d35b72980c9485f058bf1df97ca1ce6922.tar.xz
eclipse.platform.swt-44faa8d35b72980c9485f058bf1df97ca1ce6922.zip
Bug 326644 - StyledText selection erases painted characters behind last character
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java4
1 files changed, 2 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 29e204715e..df554b954f 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
@@ -637,7 +637,7 @@ public void draw (GC gc, int x, int y, int selectionStart, int selectionEnd, Col
int /*long*/ gdipSelBackground = 0, gdipSelForeground = 0, gdipFont = 0, lastHFont = 0;
int /*long*/ selBackground = 0;
int selForeground = 0;
- if (hasSelection || (flags & SWT.LAST_LINE_SELECTION) != 0) {
+ if (hasSelection || ((flags & SWT.LAST_LINE_SELECTION) != 0 && (flags & (SWT.FULL_SELECTION | SWT.DELIMITER_SELECTION)) != 0)) {
int fgSel = selectionForeground != null ? selectionForeground.handle : OS.GetSysColor (OS.COLOR_HIGHLIGHTTEXT);
int bgSel = selectionBackground != null ? selectionBackground.handle : OS.GetSysColor (OS.COLOR_HIGHLIGHT);
if (gdip) {
@@ -661,7 +661,7 @@ public void draw (GC gc, int x, int y, int selectionStart, int selectionEnd, Col
int lineHeight = lineY[line+1] - lineY[line] - lineSpacing;
//Draw last line selection
- if (flags != 0 && (hasSelection || (flags & SWT.LAST_LINE_SELECTION) != 0)) {
+ if ((flags & (SWT.FULL_SELECTION | SWT.DELIMITER_SELECTION)) != 0 && (hasSelection || (flags & SWT.LAST_LINE_SELECTION) != 0)) {
boolean extents = false;
if (line == runs.length - 1 && (flags & SWT.LAST_LINE_SELECTION) != 0) {
extents = true;