summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2010-11-08 20:09:48 +0000
committerFelipe Heidrich <fheidric>2010-11-08 20:09:48 +0000
commitc43bd660251b96f989817791778074c5e8e0d3b7 (patch)
treea7a2794b824dbc66343091791b4f2bf526f6e5ca
parente2096cd15fb807ab25cf7109265f2231ca329806 (diff)
downloadeclipse.platform.swt-c43bd660251b96f989817791778074c5e8e0d3b7.tar.gz
eclipse.platform.swt-c43bd660251b96f989817791778074c5e8e0d3b7.tar.xz
eclipse.platform.swt-c43bd660251b96f989817791778074c5e8e0d3b7.zip
326644 - StyledText selection erases painted characters behind last characterit comment
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/TextLayout.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/TextLayout.java
index 2e427560e2..8d86e49c06 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/TextLayout.java
@@ -364,7 +364,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
int length = text.length();
if (length == 0 && flags == 0) return;
boolean hasSelection = selectionStart <= selectionEnd && selectionStart != -1 && selectionEnd != -1;
- if (hasSelection || (flags & SWT.LAST_LINE_SELECTION) != 0) {
+ if (hasSelection || ((flags & SWT.LAST_LINE_SELECTION) != 0 && (flags & (SWT.FULL_SELECTION | SWT.DELIMITER_SELECTION)) != 0)) {
selectionStart = Math.min(Math.max(0, selectionStart), length - 1);
selectionEnd = Math.min(Math.max(0, selectionEnd), length - 1);
if (selectionForeground == null) selectionForeground = device.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
@@ -380,7 +380,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
int drawY = y + lineY[line];
StyleItem[] lineRuns = runs[line];
int lineHeight = lineY[line+1] - lineY[line];
- 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 extent = false;
if (line == runs.length - 1 && (flags & SWT.LAST_LINE_SELECTION) != 0) {
extent = true;