From: kiramt Date: Tue, 14 Nov 2017 10:33:33 +0000 (+0000) Subject: JAL-2831 deal with hidden cols and seqs in new cursor code X-Git-Tag: Release_2_10_3b1~28^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=24eed665b66cab524acc09a392af9189c4b51706;p=jalview.git JAL-2831 deal with hidden cols and seqs in new cursor code --- diff --git a/src/jalview/viewmodel/ViewportRanges.java b/src/jalview/viewmodel/ViewportRanges.java index 9a1e13c..0e7b431 100644 --- a/src/jalview/viewmodel/ViewportRanges.java +++ b/src/jalview/viewmodel/ViewportRanges.java @@ -625,12 +625,17 @@ public class ViewportRanges extends ViewportProperties { // if (x,y) is already visible don't do anything boolean changedLocation = false; - if (startRes > x || x > endRes || startSeq > y && y > endSeq) + + int vis_x = al.getHiddenColumns().findColumnPosition(x); + int vis_y = al.getHiddenSequences().findIndexWithoutHiddenSeqs(y); + + if (startRes > vis_x || vis_x > endRes + || startSeq > vis_y && vis_y > endSeq) { int width = getViewportWidth(); - int[] oldresvalues = updateStartEndRes(x, x + width - 1); + int[] oldresvalues = updateStartEndRes(vis_x, vis_x + width - 1); - int startseq = y; + int startseq = vis_y; int height = getViewportHeight(); if (startseq + height - 1 > getVisibleAlignmentHeight() - 1) {