Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2006-12-19 13:20:32 +0000
committerDani Megert2006-12-19 13:20:32 +0000
commit098155cb17c0ae2c6f5a6fb53fb05d999e902c75 (patch)
treea57c2ebe17ab5c38f1a48bd556348211e791bbc0
parent0e0dc47832275d19612b63b68cc75921bb0149d9 (diff)
downloadeclipse.platform.text-098155cb17c0ae2c6f5a6fb53fb05d999e902c75.tar.gz
eclipse.platform.text-098155cb17c0ae2c6f5a6fb53fb05d999e902c75.tar.xz
eclipse.platform.text-098155cb17c0ae2c6f5a6fb53fb05d999e902c75.zip
New special 3.2.2 fix for bug 161483.r322_v20061219
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java
index b70ff7734..4fb3888d9 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java
@@ -1270,8 +1270,8 @@ public class AnnotationPainter implements IPainter, PaintListener, IAnnotationMo
int firstWidgetLine= fTextWidget.getLineAtOffset(widgetClippingStartOffset);
widgetOffset= fTextWidget.getOffsetAtLine(firstWidgetLine);
} catch (IllegalArgumentException x) {
- // should not happen
- widgetOffset= 0;
+ int firstVisibleLine= JFaceTextUtil.getPartialTopIndex(fTextWidget);
+ widgetOffset= fTextWidget.getOffsetAtLine(firstVisibleLine);
}
int widgetEndOffset;
@@ -1280,9 +1280,13 @@ public class AnnotationPainter implements IPainter, PaintListener, IAnnotationMo
int lastWidgetLine= fTextWidget.getLineAtOffset(widgetClippingEndOffset);
widgetEndOffset= fTextWidget.getOffsetAtLine(lastWidgetLine + 1);
} catch (IllegalArgumentException x) {
- // happens if the editor is not "full", eg. the last line of the document is visible in the editor
- // in that case, simply use the last character
- widgetEndOffset= fTextWidget.getCharCount();
+ // happens if the editor is not "full", e.g. the last line of the document is visible in the editor
+ int lastVisibleLine= JFaceTextUtil.getPartialBottomIndex(fTextWidget);
+ if (lastVisibleLine == fTextWidget.getLineCount() - 1)
+ // last line
+ widgetEndOffset= fTextWidget.getCharCount();
+ else
+ widgetEndOffset= fTextWidget.getOffsetAtLine(lastVisibleLine + 1) - 1;
}
IRegion clippingRegion= getModelRange(widgetOffset, widgetEndOffset - widgetOffset);

Back to the top