import jalview.analysis.*;\r
\r
\r
-public class SeqCanvas extends JPanel\r
+public class SeqCanvas extends JComponent\r
{\r
FeatureRenderer fr;\r
BufferedImage img;\r
int endx = startRes+cWidth-1;\r
int ypos = 2*av.charHeight;\r
\r
-\r
while (ypos <= canvasHeight && startRes<av.alignment.getWidth() )\r
{\r
g.setColor(Color.black);\r
if(av.scaleAboveWrapped)\r
drawNorthScale(g, startRes, endx, ypos);\r
\r
- g.setClip(0, 0, cWidth*av.charWidth, getHeight());\r
+\r
+ // When printing we have an extra clipped region,\r
+ // the Printable page which we need to account for here\r
+ Shape clip = g.getClip();\r
+ if(clip==null)\r
+ g.setClip(0, 0, cWidth*av.charWidth, canvasHeight);\r
+ else\r
+ g.setClip(0,\r
+ (int)clip.getBounds().getY(),\r
+ cWidth*av.charWidth,\r
+ (int)clip.getBounds().getHeight()\r
+ );\r
+\r
drawPanel(g, startRes, endx, 0, al.getHeight(), startRes, 0, ypos);\r
- g.setClip(null);\r
+ g.setClip(clip);\r
g.translate(-LABEL_WEST,0);\r
\r
ypos += cHeight;\r