Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2010-10-14 14:56:29 +0000
committerDani Megert2010-10-14 14:56:29 +0000
commitfdd93cb05653c57b9363fd26abd911f76e4092bf (patch)
treea11cb7c50256e12da88b915554a1b40b84dc5886
parenta9adff60008493ac6e4212ff82325fe1fdbd2d09 (diff)
downloadeclipse.platform.text-fdd93cb05653c57b9363fd26abd911f76e4092bf.tar.gz
eclipse.platform.text-fdd93cb05653c57b9363fd26abd911f76e4092bf.tar.xz
eclipse.platform.text-fdd93cb05653c57b9363fd26abd911f76e4092bf.zip
Fixed bug 326644: StyledText selection erases painted characters behind last character
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java
index abd210877..ecc4fa667 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java
@@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.jface.text;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.StyledTextContent;
@@ -47,6 +48,11 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener {
private StyledText fTextWidget;
/** Tells whether the advanced graphics sub system is available. */
private final boolean fIsAdvancedGraphicsPresent;
+ /**
+ * Tells whether the text widget was created with the full selection style bit or not.
+ * @since 3.7
+ */
+ private final boolean fIsFullSelectionStyle;
/** @since 3.7 */
private boolean fShowLeadingSpaces= true;
/** @since 3.7 */
@@ -83,6 +89,7 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener {
gc.setAdvanced(true);
fIsAdvancedGraphicsPresent= gc.getAdvanced();
gc.dispose();
+ fIsFullSelectionStyle= (fTextWidget.getStyle() & SWT.FULL_SELECTION) != SWT.NONE;
}
/**
@@ -421,7 +428,7 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener {
* Block selection is drawn using alpha and no selection-inverting
* takes place, we always draw as 'unselected' in block selection mode.
*/
- if (!fTextWidget.getBlockSelection() && isOffsetSelected(fTextWidget, widgetOffset)) {
+ if (!fTextWidget.getBlockSelection() && fIsFullSelectionStyle && isOffsetSelected(fTextWidget, widgetOffset)) {
fg= fTextWidget.getSelectionForeground();
} else if (styleRange == null || styleRange.start + styleRange.length <= widgetOffset) {
styleRange= fTextWidget.getStyleRangeAtOffset(widgetOffset);

Back to the top