Community
Participate
Working Groups
int pixel1= Math.min(rulerLength, y_coordinate + 1);
rulerLength= Math.max(rulerLength, 1);
lines[0]= (pixel0 * maxLines) / rulerLength;
// if the ruler is very big, rounding off is heavy
lines[1]= (pixel1 * maxLines) / rulerLength;
if(rulerLength > maxLines){
lines[0]= (int)(pixel0 * (maxLines / (double)rulerLength));
lines[1]= (int)(pixel1 * (maxLines / (double)rulerLength));
}else{
lines[0]= pixel0 * (maxLines / rulerLength);
lines[1]= pixel1 * (maxLines / rulerLength);
}
// hit test should be only for the annotation height - not for the entire line length
if(y_coordinate > (((lines[0]* rulerLength)/maxLines) + fAnnotationHeight))
return new int[] {-1, -1};
if (fTextViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;