/** * Does not paint hidden annotations. Annotations are hidden when they * only span one line. * * @see ProjectionAnnotation#paint(org.eclipse.swt.graphics.GC, * org.eclipse.swt.widgets.Canvas, * org.eclipse.swt.graphics.Rectangle) */ public void paint(GC gc, Canvas canvas, Rectangle rectangle) { /* workaround for BUG85874 */ /* * only need to check annotations that are expanded because hidden * annotations should never have been given the chance to * collapse. */ if (!isCollapsed()) { // working with rectangle, so line height FontMetrics metrics = gc.getFontMetrics(); if (metrics != null) { // do not draw annotations that only span one line and // mark them as not visible if ((rectangle.height / metrics.getHeight()) <= 1) { fIsVisible = false; return; } } } fIsVisible = true; super.paint(gc, canvas, rectangle); }