private void doPaint1(GC gc) {
Rectangle r= new Rectangle(0, 0, 0, 0);
int yy, hh= ANNOTATION_HEIGHT;
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
IDocument document= fTextViewer.getDocument();
StyledText textWidget= fTextViewer.getTextWidget();
int maxLines= textWidget.getLineCount();
Point size= fCanvas.getSize();
int writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines);
if (size.y > writable)
size.y= Math.max(writable - fHeader.getSize().y, 0);
for (Iterator iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) {
Object annotationType= iterator.next();
if (skip(annotationType))
continue;
int[] style= new int[] { FilterIterator.PERSISTENT, FilterIterator.TEMPORARY };
for (int t=0; t < style.length; t++) {
Iterator e= new FilterIterator(annotationType, style[t], fCachedAnnotations.iterator());
Color fill= getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY);
Color stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY);
for (int i= 0; e.hasNext(); i++) {
Annotation a= (Annotation) e.next();
Position p= fModel.getPosition(a);
if (p == null)
continue;
IRegion widgetRegion= extension.modelRange2WidgetRange(new Region(p.getOffset(), p.getLength()));
if (widgetRegion == null)
continue;
try {
if (ANNOTATION_HEIGHT_SCALABLE) {