From: Ben Soares Date: Mon, 28 Aug 2023 19:17:32 +0000 (+0100) Subject: Merge branch 'develop' into merge/big_merge_of_bens_stuff_before_2_11_3_0 X-Git-Tag: Release_2_11_3_0~8^2~34 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1d4324b37f248818b6bf5ba18e144f57299dc308;hp=-c;p=jalview.git Merge branch 'develop' into merge/big_merge_of_bens_stuff_before_2_11_3_0 --- 1d4324b37f248818b6bf5ba18e144f57299dc308 diff --combined src/jalview/gui/SeqCanvas.java index 0faedb0,62e48d2..39039eb --- a/src/jalview/gui/SeqCanvas.java +++ b/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); @@@ -362,7 -362,7 +362,7 @@@ // 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 { @@@ -550,20 -550,6 +550,20 @@@ 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 @@@ -1389,8 -1375,8 +1389,8 @@@ } 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; @@@ -1401,8 -1387,8 +1401,8 @@@ 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); } } } @@@ -1679,7 -1665,7 +1679,7 @@@ 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; @@@ -1689,7 -1675,7 +1689,7 @@@ 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; }