X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FScalePanel.java;h=71ecb132efb31103312dfa939c98e5390d7b7ec2;hb=4eb1ed22600411fe5b6e9ac93084b45429ccfad6;hp=3c6a4f146c0ba1f652efd462f55ecff3eb13cbeb;hpb=e2399fe0a610faf5dee11a68a8643c34e3ef2490;p=jalview.git diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 3c6a4f1..71ecb13 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -410,6 +410,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, int avcharWidth = av.getCharWidth(), avcharHeight = av.getCharHeight(); for (int sel : cs.getSelected()) { + // TODO: JAL-2001 - provide a fast method to list visible selected in a + // given range if (av.hasHiddenColumns()) { sel = av.getColumnSelection().findColumnPosition(sel); @@ -426,6 +428,7 @@ public class ScalePanel extends Panel implements MouseMotionListener, gg.setColor(Color.black); int scalestartx = (startx / 10) * 10; + int widthx = 1 + endx - startx; FontMetrics fm = gg.getFontMetrics(av.getFont()); int y = avcharHeight - fm.getDescent(); @@ -477,7 +480,7 @@ public class ScalePanel extends Panel implements MouseMotionListener, res = av.getColumnSelection().findHiddenRegionPosition(i) - startx; - if (res < 0 || res > endx - scalestartx) + if (res < 0 || res > widthx) { continue; }