JAL-4026 update the viewport’s wrapped width after calculating it
authorJim Procter <j.procter@dundee.ac.uk>
Thu, 9 Jun 2022 07:18:31 +0000 (08:18 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Thu, 9 Jun 2022 09:09:23 +0000 (10:09 +0100)
src/jalview/gui/SeqCanvas.java

index ac7cf10..d15cdcf 100755 (executable)
  */
 package jalview.gui;
 
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.HiddenColumns;
-import jalview.datamodel.SearchResultsI;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.datamodel.VisibleContigsIterator;
-import jalview.renderer.ScaleRenderer;
-import jalview.renderer.ScaleRenderer.ScaleMark;
-import jalview.util.Comparison;
-import jalview.viewmodel.ViewportListenerI;
-import jalview.viewmodel.ViewportRanges;
-
 import java.awt.BasicStroke;
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -47,6 +35,18 @@ import java.util.List;
 
 import javax.swing.JPanel;
 
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.SearchResultsI;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.datamodel.VisibleContigsIterator;
+import jalview.renderer.ScaleRenderer;
+import jalview.renderer.ScaleRenderer.ScaleMark;
+import jalview.util.Comparison;
+import jalview.viewmodel.ViewportListenerI;
+import jalview.viewmodel.ViewportRanges;
+
 /**
  * The Swing component on which the alignment sequences, and annotations (if
  * shown), are drawn. This includes scales above, left and right (if shown) in
@@ -690,7 +690,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI
      * compute width in residues; this also sets East and West label widths
      */
     int wrappedWidthInResidues = getWrappedCanvasWidth(canvasWidth);
-
+    av.setWrappedWidth(wrappedWidthInResidues); // update model accordingly
     /*
      *  limit visibleWidths to not exceed width of alignment
      */