+ // calculate translation in pixel terms:
+ // get mouse location in viewport coords, add translation in viewport
+ // coords,
+ // convert back to pixel coords
+ int vpx = Math.round((float) mousex * alwidth / width);
+ int visXAsRes = hiddenCols.absoluteToVisibleColumn(vpx) + xdiff;
+
+ int vpy = Math.round(mousey * heightRatio);
+ int visYAsRes = hiddenSeqs.findIndexWithoutHiddenSeqs(vpy) + ydiff;
+
+ // update viewport accordingly
+ updateViewportFromTopLeft(visXAsRes, visYAsRes, hiddenSeqs, hiddenCols);
+ }
+
+ /**
+ * {@inheritDoc} Callers should have already called resetAlignmentDims to
+ * refresh alwidth, alheight and width/height ratios
+ */
+ @Override
+ protected void updateViewportFromTopLeft(int leftx, int topy,
+ HiddenSequences hiddenSeqs, HiddenColumns hiddenCols)
+ {
+ int visXAsRes = leftx;
+ int visYAsSeq = topy;
+
+ if (visXAsRes < 0)