From 24eed665b66cab524acc09a392af9189c4b51706 Mon Sep 17 00:00:00 2001 From: kiramt Date: Tue, 14 Nov 2017 10:33:33 +0000 Subject: [PATCH] JAL-2831 deal with hidden cols and seqs in new cursor code --- src/jalview/viewmodel/ViewportRanges.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) { -- 1.7.10.2