From 669bd979e7fbfeaff2a48d1c335cdb5cd2d32902 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 8 Apr 2016 15:43:58 +0100 Subject: [PATCH] JAL-2053 fix erratic hidden column marker display --- src/jalview/appletgui/ScalePanel.java | 3 ++- src/jalview/gui/ScalePanel.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 9106385..71ecb13 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -428,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(); @@ -479,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; } diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 7e17f46..41de58f 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -493,6 +493,7 @@ public class ScalePanel extends JPanel 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(); @@ -540,11 +541,10 @@ public class ScalePanel extends JPanel implements MouseMotionListener, for (int i = 0; i < av.getColumnSelection().getHiddenColumns() .size(); i++) { - res = av.getColumnSelection().findHiddenRegionPosition(i) - startx; - if (res < 0 || res > endx - scalestartx) + if (res < 0 || res > widthx) { continue; } -- 1.7.10.2