From: Jim Procter Date: Thu, 27 Feb 2020 17:27:41 +0000 (+0000) Subject: Merge branch 'bug/JAL-3412idWidthDiscrepancy' into develop X-Git-Tag: Develop-2_11_2_0-d20201215~83 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4709e163f0a98e83ef0b7e5c860d6e10bca32480;hp=d0a3c7594380d978b0d3bf3cbdba55a016b9d920;p=jalview.git Merge branch 'bug/JAL-3412idWidthDiscrepancy' into develop --- diff --git a/help/help/html/releases.html b/help/help/html/releases.html index 54a851f..cc6b1f9 100755 --- a/help/help/html/releases.html +++ b/help/help/html/releases.html @@ -114,6 +114,9 @@ li:before {
  • + ID margin for CDS and Protein views not equal when split frame is first opened +
  • +
  • Sequence position numbers in status bar not correct after editing a sequence's start position via GUI
  • diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 85ca37c..203220a 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -34,6 +34,7 @@ import jalview.viewmodel.ViewportRanges; import java.awt.Dimension; import java.awt.Font; +import java.awt.FontMetrics; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -226,8 +227,12 @@ public class AlignmentPanelTest */ AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[0]; aa.label = "THIS IS A VERY LONG LABEL INDEED"; + FontMetrics fmfor = af.alignPanel + .getFontMetrics(af.alignPanel.getAlabels().getFont()); + // Assumption ID_WIDTH_PADDING == 4 + int expwidth = 4 + fmfor.stringWidth(aa.label); d = af.alignPanel.calculateIdWidth(2000); - assertEquals(d.width, 229); // 4 + pixel width of "THIS IS A VERY LONG LABEL INDEED" + assertEquals(d.width, expwidth); // 228 == ID_WIDTH_PADDING + pixel width of "THIS IS A VERY LONG LABEL INDEED" assertEquals(d.height, 12); /*