Merge branch 'develop' into merge/big_merge_of_bens_stuff_before_2_11_3_0
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 28 Aug 2023 19:17:32 +0000 (20:17 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 28 Aug 2023 19:17:32 +0000 (20:17 +0100)
1  2 
src/jalview/gui/SeqCanvas.java

@@@ -343,7 -343,7 +343,7 @@@ public class SeqCanvas extends JPanel i
          }
        }
  
 -      // System.err.println(">>> FastPaint to " + transX + " " + transY + " "
 +      // jalview.bin.Console.errPrintln(">>> FastPaint to " + transX + " " + transY + " "
        // + horizontal + " " + vertical + " " + startRes + " " + endRes
        // + " " + startSeq + " " + endSeq);
  
        // Call repaint on alignment panel so that repaints from other alignment
        // panel components can be aggregated. Otherwise performance of the
        // overview window and others may be adversely affected.
 -      // System.out.println("SeqCanvas fastPaint() repaint() request...");
 +      // jalview.bin.Console.outPrintln("SeqCanvas fastPaint() repaint() request...");
        av.getAlignPanel().repaint();
      } finally
      {
      return (canvasWidth - labelWidthEast - labelWidthWest) / charWidth;
    }
  
 +  public int getMinimumWrappedCanvasWidth()
 +  {
 +    int charWidth = av.getCharWidth();
 +    FontMetrics fm = getFontMetrics(av.getFont());
 +    int labelWidth = 0;
 +    if (av.getScaleRightWrapped() || av.getScaleLeftWrapped())
 +    {
 +      labelWidth = getLabelWidth(fm);
 +    }
 +    labelWidthEast = av.getScaleRightWrapped() ? labelWidth : 0;
 +    labelWidthWest = av.getScaleLeftWrapped() ? labelWidth : 0;
 +    return labelWidthEast + labelWidthWest + charWidth;
 +  }
 +
    /**
     * Returns a pixel width sufficient to show the largest sequence coordinate
     * (end position) in the alignment, calculated as the FontMetrics width of
          }
          else if (inGroup)
          {
-           drawVerticals(g, sx, xwidth, visWidth, oldY, sy);
-           drawHorizontals(g, sx, xwidth, visWidth, top, bottom);
+           drawVerticals(g, sx, xwidth, visWidth, oldY, bottom);
+           drawHorizontals(g, sx, xwidth, visWidth, top, bottom+1);
  
            // reset top and bottom
            top = -1;
        if (inGroup)
        {
          sy = verticalOffset + ((i - startSeq) * charHeight);
-         drawVerticals(g, sx, xwidth, visWidth, oldY, sy);
-         drawHorizontals(g, sx, xwidth, visWidth, top, bottom);
+         drawVerticals(g, sx, xwidth, visWidth, oldY, bottom);
+         drawHorizontals(g, sx, xwidth, visWidth, top, bottom+1);
        }
      }
    }
    public void propertyChange(PropertyChangeEvent evt)
    {
      String eventName = evt.getPropertyName();
 -    // System.err.println(">>SeqCanvas propertyChange " + eventName);
 +    // jalview.bin.Console.errPrintln(">>SeqCanvas propertyChange " + eventName);
      if (eventName.equals(SequenceGroup.SEQ_GROUP_CHANGED))
      {
        fastPaint = true;
      else if (eventName.equals(ViewportRanges.MOVE_VIEWPORT))
      {
        fastPaint = false;
 -      // System.err.println("!!!! fastPaint false from MOVE_VIEWPORT");
 +      // jalview.bin.Console.errPrintln("!!!! fastPaint false from MOVE_VIEWPORT");
        repaint();
        return;
      }