From: gmungoc Date: Sun, 12 Apr 2020 12:24:24 +0000 (+0100) Subject: JAL-3596 don't draw text over features if Show Text is unselected X-Git-Tag: Develop-2_11_2_0-d20201215~40 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0eca06f81d58886f044eb37f8a1a702f497434cf;p=jalview.git JAL-3596 don't draw text over features if Show Text is unselected --- diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java index a1980c7..7a92a88 100644 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -20,6 +20,13 @@ */ package jalview.renderer.seqfeatures; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.util.List; + import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.datamodel.ContiguousI; @@ -32,13 +39,6 @@ import jalview.util.Comparison; import jalview.util.ReverseListIterator; import jalview.viewmodel.seqfeatures.FeatureRendererModel; -import java.awt.AlphaComposite; -import java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.util.List; - public class FeatureRenderer extends FeatureRendererModel { private static final AlphaComposite NO_TRANSPARENCY = AlphaComposite @@ -112,10 +112,13 @@ public class FeatureRenderer extends FeatureRendererModel continue; } - g.setColor(Color.white); - int charOffset = (charWidth - fm.charWidth(s)) / 2; - g.drawString(String.valueOf(s), - charOffset + (charWidth * (i - start)), pady); + if (av.getShowText()) + { + g.setColor(Color.white); + int charOffset = (charWidth - fm.charWidth(s)) / 2; + g.drawString(String.valueOf(s), + charOffset + (charWidth * (i - start)), pady); + } } return true; }