+
+ widthRatio = (float) alwidth / width;
+ heightRatio = (float) alheight / sequencesHeight;
+ }
+
+ /**
+ * {@inheritDoc} Callers should have already called resetAlignmentDims to
+ * refresh widthRatio
+ */
+ @Override
+ protected int getLeftXFromCentreX(int mousex, HiddenColumns hidden)
+ {
+ int vpx = Math.round((float) mousex * alwidth / width);
+ return hidden.offsetByVisibleColumns(-ranges.getViewportWidth() / 2,
+ vpx);
+ }
+
+ /**
+ * {@inheritDoc} Callers should have already called resetAlignmentDims to
+ * refresh heightRatio
+ */
+ @Override
+ protected int getTopYFromCentreY(int mousey, HiddenSequences hidden)
+ {
+ int vpy = Math.round(mousey * heightRatio);
+ return hidden.subtractVisibleRows(ranges.getViewportHeight() / 2, vpy);
+ }
+
+ @Override
+ public void setDragPoint(int x, int y, HiddenSequences hiddenSeqs,
+ HiddenColumns hiddenCols)
+ {
+ resetAlignmentDims();
+
+ // 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);