- int lastcol = -1, lastrow = -1;
- int color = Color.white.getRGB();
- int row, col;
- jalview.datamodel.SequenceI seq;
- boolean hiddenRow = false;
- for (row = 0; row < sequencesHeight; row++)
+ // calculate sampleCol and sampleRow
+ // alignment width is max number of residues/bases
+ // alignment height is number of sequences
+ int alwidth = av.getAlignment().getWidth();
+ int alheight = av.getAlignment().getHeight()
+ + av.getAlignment().getHiddenSequences().getSize();
+
+ // sampleCol or sampleRow is the width/height allocated to each residue
+ // in particular, sometimes we may need more than one row/col of the
+ // BufferedImage allocated
+ // sampleCol is how much of a residue to assign to each pixel
+ // sampleRow is how many sequences to assign to each pixel
+ float sampleCol = alwidth / (float) od.getWidth();
+ float sampleRow = alheight / (float) od.getSequencesHeight();
+
+ buildImage(sampleRow, sampleCol);
+
+ if (av.getAlignmentConservationAnnotation() != null)