From 612e5d088076c3db73608deddfa1da02c1c5c5dc Mon Sep 17 00:00:00 2001 From: kiramt Date: Tue, 10 Oct 2017 14:30:43 +0100 Subject: [PATCH] JAL-2690attemptedmerge seems to work --- src/jalview/gui/SeqCanvas.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 8ad094f..70ac11f 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -527,6 +527,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI { BufferedImage lcimg = null; + int charWidth = av.getCharWidth(); + int charHeight = av.getCharHeight(); + int width = getWidth(); int height = getHeight(); @@ -772,7 +775,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI */ int xOffset = labelWidthWest + ((startColumn - ranges.getStartRes()) % viewportWidth) - * charWidth; + * charWidth; g.translate(xOffset, 0); // When printing we have an extra clipped region, @@ -785,8 +788,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI } else { - g.setClip(0, (int) clip.getBounds().getY(), viewportWidth * charWidth, - (int) clip.getBounds().getHeight()); + g.setClip(0, (int) clip.getBounds().getY(), + viewportWidth * charWidth, (int) clip.getBounds().getHeight()); } /* @@ -859,9 +862,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI * (to support incremental fast paint of image) */ g.setColor(Color.white); - g.fillRect(0, ypos - wrappedSpaceAboveAlignment, - viewportWidth * charWidth + labelWidthWest, - wrappedSpaceAboveAlignment); + g.fillRect(0, ypos - wrappedSpaceAboveAlignment, viewportWidth + * charWidth + labelWidthWest, wrappedSpaceAboveAlignment); g.setColor(Color.black); g.translate(labelWidthWest, 0); @@ -928,6 +930,9 @@ public class SeqCanvas extends JComponent implements ViewportListenerI int canvasWidth, int canvasHeight, int startRes) { + int charHeight = av.getCharHeight(); + int charWidth = av.getCharWidth(); + // height gap above each panel int hgap = charHeight; if (av.getScaleAboveWrapped()) -- 1.7.10.2