X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=c4424655edc22241d5fc2c48aab764569b5101ea;hb=b14411143cbfb4d311f68b3d3b73a645bf8200e8;hp=1194d08afceca7ad43f51caf76d68317ffdd3b40;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 1194d08..c442465 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -44,13 +44,15 @@ public class SeqCanvas int LABEL_WEST; int LABEL_EAST; + public SeqCanvas(AlignViewport av) { this.av = av; fr = new FeatureRenderer(av); sr = new SequenceRenderer(av); setLayout(new BorderLayout()); - PaintRefresher.Register(this); + PaintRefresher.Register(this, av.alignment); + setBackground(Color.white); } void drawNorthScale(Graphics g, int startx, int endx, int ypos) @@ -212,16 +214,17 @@ public class SeqCanvas * NOTE 1: The av limits are set in setFont in this class and * in the adjustment listener in SeqPanel when the scrollbars move. */ + + + // Set this to false to force a full panel paint public void paintComponent(Graphics g) { - g.setColor(Color.white); - g.fillRect(0, 0, getWidth(), getHeight()); - - if (fastPaint) + if (img!=null + && (fastPaint || getWidth() != g.getClipBounds().width + || getHeight() != g.getClipBounds().height)) { g.drawImage(img, 0, 0, this); fastPaint = false; - return; }