diff options
author | Dani Megert | 2017-05-23 09:17:46 +0000 |
---|---|---|
committer | Dani Megert | 2017-05-23 10:43:43 +0000 |
commit | a7f6ec37f4889b1fc268d7331b11275c82583b9c (patch) | |
tree | 73f34393a55dbe09720af3ec345e0be21da36992 | |
parent | 58fb05181030ab9105edb1d26f36f206f74ab4dc (diff) | |
download | eclipse.platform.text-a7f6ec37f4889b1fc268d7331b11275c82583b9c.tar.gz eclipse.platform.text-a7f6ec37f4889b1fc268d7331b11275c82583b9c.tar.xz eclipse.platform.text-a7f6ec37f4889b1fc268d7331b11275c82583b9c.zip |
Revert "Bug 434194" - restore 4.6 versionY20170622-1000Y20170620-0625Y20170619-2325Y20170618-0415Y20170608-1000Y20170601-1000Y20170525-1000S4_7_0_RC4aS4_7_0_RC4S4_7_0_RC3S4_7_0_RC2R4_7I20170612-0950I20170610-0940I20170608-0530I20170607-2000I20170607-1100I20170607-0800I20170607-0215I20170606-2000I20170606-0800I20170605-2000I20170605-0800I20170604-2000I20170604-0800I20170603-1500I20170603-0800I20170603-0100I20170602-2000I20170531-2000I20170531-0800I20170530-2000I20170530-0800I20170529-2000I20170529-0800I20170528-2000I20170528-0800I20170527-1500I20170527-0800I20170526-2000I20170524-2000I20170524-0800I20170523-2000
Change-Id: If2ca0a94f8ae0b58b2d8ef9da714d3b966c87363
Signed-off-by: Dani Megert <daniel_megert@ch.ibm.com>
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java | 30 |
1 files changed, 7 insertions, 23 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 d478be05167..4a5bd8eeedd 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2017 Wind River Systems, Inc., IBM Corporation and others. + * Copyright (c) 2006, 2012 Wind River Systems, Inc., IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -215,13 +215,6 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener { */ private void drawLineRange(GC gc, int startLine, int endLine, int x, int w) { final int viewPortWidth= fTextWidget.getClientArea().width; - int spaceCharWidth = gc.stringExtent(" ").x; //$NON-NLS-1$ - boolean optimizeWhitespacePainting = false; - if ( (spaceCharWidth == gc.stringExtent(String.valueOf(SPACE_SIGN)).x) && - (spaceCharWidth == gc.stringExtent(String.valueOf(IDEOGRAPHIC_SPACE_SIGN)).x)) { - optimizeWhitespacePainting = true; - } - for (int line= startLine; line <= endLine; line++) { int lineOffset= fTextWidget.getOffsetAtLine(line); // line end offset including line delimiter @@ -275,7 +268,7 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener { } // draw character range if (endOffset > startOffset) { - drawCharRange(gc, startOffset, endOffset, lineOffset, lineEndOffset, optimizeWhitespacePainting); + drawCharRange(gc, startOffset, endOffset, lineOffset, lineEndOffset); } } } @@ -292,9 +285,8 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener { * @param endOffset exclusive end index of the drawing range * @param lineOffset inclusive start index of the line * @param lineEndOffset exclusive end index of the line - * @param optimizeWhitespacePainting <code>true</code> if whitespace painting can be optimized, <code>false</code> otherwise */ - private void drawCharRange(GC gc, int startOffset, int endOffset, int lineOffset, int lineEndOffset, boolean optimizeWhitespacePainting) { + private void drawCharRange(GC gc, int startOffset, int endOffset, int lineOffset, int lineEndOffset) { StyledTextContent content= fTextWidget.getContent(); String lineText= content.getTextRange(lineOffset, lineEndOffset - lineOffset); int startOffsetInLine= startOffset - lineOffset; @@ -346,12 +338,8 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener { visibleChar.append(SPACE_SIGN); } } - // 'continue' improves performance but may produce drawing errors - // for long runs of space if width of space and dot differ, therefore - // it can be used only for monospace fonts - if (optimizeWhitespacePainting) { - continue; - } + // 'continue' would improve performance but may produce drawing errors + // for long runs of space if width of space and dot differ break; case '\u3000': // ideographic whitespace if (isEmptyLine) { @@ -371,12 +359,8 @@ public class WhitespaceCharacterPainter implements IPainter, PaintListener { visibleChar.append(IDEOGRAPHIC_SPACE_SIGN); } } - // 'continue' improves performance but may produce drawing errors - // for long runs of space if width of space and dot differ, therefore - // it can be used only for monospace fonts - if (optimizeWhitespacePainting) { - continue; - } + // 'continue' would improve performance but may produce drawing errors + // for long runs of space if width of space and dot differ break; case '\t': if (isEmptyLine) { |