Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 163769 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jface/text/source/OverviewRuler.java (-2 / +12 lines)
Lines 850-857 Link Here
850
		int pixel1= Math.min(rulerLength, y_coordinate + 1);
850
		int pixel1= Math.min(rulerLength, y_coordinate + 1);
851
		rulerLength= Math.max(rulerLength, 1);
851
		rulerLength= Math.max(rulerLength, 1);
852
852
853
		lines[0]= (pixel0 * maxLines) / rulerLength;
853
		// if the ruler is very big, rounding off is heavy
854
		lines[1]= (pixel1 * maxLines) / rulerLength;
854
		if(rulerLength > maxLines){
855
			lines[0]= (int)(pixel0 * (maxLines / (double)rulerLength));
856
			lines[1]= (int)(pixel1 * (maxLines / (double)rulerLength));
857
		}else{
858
			lines[0]= pixel0 * (maxLines / rulerLength);
859
			lines[1]= pixel1 * (maxLines / rulerLength);
860
		}
861
		
862
		// hit test should be only for the annotation height - not for the entire line length
863
		if(y_coordinate > (((lines[0]* rulerLength)/maxLines) + fAnnotationHeight))
864
			return new int[] {-1, -1};
855
865
856
		if (fTextViewer instanceof ITextViewerExtension5) {
866
		if (fTextViewer instanceof ITextViewerExtension5) {
857
			ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
867
			ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;

Return to bug 163769