From eceeb384e2117b35c85a0abdf69a6ddaafd66b6e Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 3 Jul 2017 15:17:27 +0100 Subject: [PATCH] JAL-147 don't draw ScalePanel when in wrapped mode --- src/jalview/appletgui/ScalePanel.java | 12 +++++++++--- src/jalview/gui/ScalePanel.java | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 1737c01..f580d85 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -350,9 +350,15 @@ public class ScalePanel extends Panel implements MouseMotionListener, @Override public void paint(Graphics g) { - drawScale(g, av.getRanges().getStartRes(), av.getRanges().getEndRes(), - getSize().width, - getSize().height); + /* + * shouldn't get called in wrapped mode as the scale above is + * drawn instead by SeqCanvas.drawNorthScale + */ + if (!av.getWrapAlignment()) + { + drawScale(g, av.getRanges().getStartRes(), + av.getRanges().getEndRes(), getSize().width, getSize().height); + } } // scalewidth will normally be screenwidth, diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e5f2be8..ec03681 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -422,8 +422,15 @@ public class ScalePanel extends JPanel implements MouseMotionListener, @Override public void paintComponent(Graphics g) { - drawScale(g, av.getRanges().getStartRes(), av.getRanges().getEndRes(), - getWidth(), getHeight()); + /* + * shouldn't get called in wrapped mode as the scale above is + * drawn instead by SeqCanvas.drawNorthScale + */ + if (!av.getWrapAlignment()) + { + drawScale(g, av.getRanges().getStartRes(), + av.getRanges().getEndRes(), getWidth(), getHeight()); + } } // scalewidth will normally be screenwidth, -- 1.7.10.2