Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorazerr2018-04-27 12:04:54 -0400
committerazerr2018-04-27 12:04:54 -0400
commitcc244ba39902c89fe397d5f4369288a38c370910 (patch)
treebe7d42bb6a3e504bad71583b126c38f814f30a28 /org.eclipse.jface.text/src
parent82a6d90a928017264f0f62c0b8c45626a2cec119 (diff)
downloadeclipse.platform.text-cc244ba39902c89fe397d5f4369288a38c370910.tar.gz
eclipse.platform.text-cc244ba39902c89fe397d5f4369288a38c370910.tar.xz
eclipse.platform.text-cc244ba39902c89fe397d5f4369288a38c370910.zip
Bug 534156 - [code mining] Don't redraw character for line contentI20180430-0715I20180429-2000I20180428-2020I20180428-1500I20180427-2000
annotation if character is a line delimiter Change-Id: I25ba2750f8d1616835b7bddf3d8bdd1e89a0b74e Signed-off-by: azerr <angelo.zerr@gmail.com>
Diffstat (limited to 'org.eclipse.jface.text/src')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
index bda109202..b05a8482f 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
@@ -268,23 +268,25 @@ class InlinedAnnotationDrawingStrategy implements IDrawingStrategy {
// START TO REMOVE
// The inline annotation replaces one character by taking a place width
// GlyphMetrics
- // Here we need to redraw this first character because GlyphMetrics clip this
+ // Here we need to redraw this first character (if it's not a line delimiter) because GlyphMetrics clip this
// character.
- int charX= x + bounds.width - charWidth;
- int charY= y;
- if (style != null) {
- if (style.background != null) {
- gc.setBackground(style.background);
- gc.fillRectangle(charX, charY, charWidth + 1, bounds.height);
+ if (!("\r".equals(s) || "\n".equals(s))) { //$NON-NLS-1$ //$NON-NLS-2$
+ int charX= x + bounds.width - charWidth;
+ int charY= y;
+ if (style != null) {
+ if (style.background != null) {
+ gc.setBackground(style.background);
+ gc.fillRectangle(charX, charY, charWidth + 1, bounds.height);
+ }
+ if (style.foreground != null) {
+ gc.setForeground(style.foreground);
+ } else {
+ gc.setForeground(textWidget.getForeground());
+ }
+ gc.setFont(annotation.getFont(style.fontStyle));
}
- if (style.foreground != null) {
- gc.setForeground(style.foreground);
- } else {
- gc.setForeground(textWidget.getForeground());
- }
- gc.setFont(annotation.getFont(style.fontStyle));
+ gc.drawString(s, charX, charY, true);
}
- gc.drawString(s, charX, charY, true);
// END TO REMOVE
} else if (style != null && style.metrics != null && style.metrics.width != 0) {
// line content annotation had an , reset it

Back to the top