- int vpy = Math.round((float) y * alheight / sequencesHeight);
- fixedY = ranges.getStartSeq()
- - hiddenSeqs.findIndexWithoutHiddenSeqs(vpy);
- }
+ // get alignment position of x and box (can get directly from vpranges) and
+ // calculate difference between the positions
+ int vpx = Math.round(x * widthRatio);
+ int vpy = Math.round(y * heightRatio);
+
+ xdiff = ranges.getStartRes() - hiddenCols.absoluteToVisibleColumn(vpx);
+ ydiff = ranges.getStartSeq()
+ - hiddenSeqs.findIndexWithoutHiddenSeqs(vpy);