From 46be82307a1be9c637e0f3e2a34631692731eeb7 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 23 Mar 2005 11:57:06 +0000 Subject: [PATCH] correct wrap alignment scrollbar size --- src/jalview/gui/AlignmentPanel.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 95a8e7c..506fb09 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -244,29 +244,28 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene av.charHeight / 2 + 12)); scalePanelHolder.setPreferredSize(new Dimension(500, av.charHeight / 2 + 12)); + if (av.getWrapAlignment()) { int max = av.alignment.getWidth() / - (seqPanel.seqCanvas.getWidth() / av.charWidth) + 1; + (seqPanel.seqCanvas.getWidth() / av.charWidth)+1 ; - int h = (av.alignment.getHeight() + 2) * av.charHeight; - vextent = seqPanel.seqCanvas.getHeight() / h; - vscroll.setValues(0, vextent, 0, max); + vscroll.setValues(0, 1, 0, max); } else + { + av.getConsensus(true); + if (overviewPanel != null) + overviewPanel.updateOverviewImage(); + setScrollValues(av.getStartRes(), av.getStartSeq()); + } - av.getConsensus(true); - if (overviewPanel != null) - overviewPanel.updateOverviewImage(); - - validate(); - setScrollValues(av.getStartRes(), av.getStartSeq()); repaint(); } + int hextent = 0; int vextent = 0; - // return value is true if the scroll is valid public boolean scrollUp(boolean up) { -- 1.7.10.2