Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelozerr2017-12-21 18:53:24 +0000
committerangelozerr2017-12-21 18:53:24 +0000
commite76fdc71f32c1c24eb4a7541357fc4ec9309ec75 (patch)
tree90949201820c36989f09d8d714a3a17cdeef7bfd
parentfbf48eb2c866c228064cd1e70e4164a19449eeac (diff)
downloadeclipse.platform.text-e76fdc71f32c1c24eb4a7541357fc4ec9309ec75.tar.gz
eclipse.platform.text-e76fdc71f32c1c24eb4a7541357fc4ec9309ec75.tar.xz
eclipse.platform.text-e76fdc71f32c1c24eb4a7541357fc4ec9309ec75.zip
top Change-Id: I1a45c53446bc05334e03b79f447d1c214c7b6f89 Signed-off-by: angelozerr <angelo.zerr@gmail.com>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java10
1 files changed, 6 insertions, 4 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 1580511fd91..8a9647f356b 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
@@ -18,6 +18,8 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.GlyphMetrics;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
import org.eclipse.jface.text.JFaceTextUtil;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy;
@@ -86,10 +88,10 @@ class InlinedAnnotationDrawingStrategy implements IDrawingStrategy {
}
int previousLineIndex= lineIndex - 1;
// check the previous line index where annotation must be drawn in line spacing is not hidden
- int firstLineIndex= JFaceTextUtil.getPartialTopIndex(annotation.getViewer());
- if (previousLineIndex < firstLineIndex) {
- // the previous line index where annotation must be drawn in line spacing is hidden, don't draw it.
- return;
+ ITextViewer viewer= annotation.getViewer();
+ int firstLineIndex= JFaceTextUtil.getPartialTopIndex(viewer);
+ if (viewer instanceof ITextViewerExtension5) {
+ firstLineIndex= ((ITextViewerExtension5) viewer).modelLine2WidgetLine(firstLineIndex);
}
if (gc != null) {
// Compute the location of the annotation

Back to the top