From: amwaterhouse Date: Fri, 3 Dec 2004 16:31:09 +0000 (+0000) Subject: av.charWidth is now an int X-Git-Tag: Release_2_0~864 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dc7f045c7a410ac471c981bf356d8b1ab62f2f15;p=jalview.git av.charWidth is now an int --- diff --git a/src/jalview/gui/ScaleCanvas.java b/src/jalview/gui/ScaleCanvas.java index 7e4b617..d708248 100755 --- a/src/jalview/gui/ScaleCanvas.java +++ b/src/jalview/gui/ScaleCanvas.java @@ -26,7 +26,7 @@ public class ScaleCanvas extends JPanel { public void drawScale(Graphics gg, int startx, int endx, int scaleWidth) { - double charWidth = av.getCharWidth(); + int charWidth = av.getCharWidth(); gg.setFont(av.getFont()); @@ -66,7 +66,7 @@ public class ScaleCanvas extends JPanel { //Fill the selected columns ColumnSelection cs = av.getColumnSelection(); - int width = (int)charWidth; + int width = charWidth; if (width == 0) width = 1; @@ -76,7 +76,7 @@ public class ScaleCanvas extends JPanel { // System.out.println("Selection = " + sel); if ( sel >= startx && sel <= endx) { - gg.fillRect((int)((sel-startx)*charWidth),0,width,getHeight()); + gg.fillRect((sel-startx)*charWidth,0,width,getHeight()); } } @@ -88,7 +88,7 @@ public class ScaleCanvas extends JPanel { String string = String.valueOf(i); - gg.drawString(string,(int)((i-startx-1)*charWidth),15); + gg.drawString(string,(i-startx-1)*charWidth,15); gg.drawLine( (int)((i-startx-1)*charWidth +charWidth/2), 17, (int)((i-startx-1)*charWidth +charWidth/2), 24); } diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e25a4bb..73be873 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -40,7 +40,7 @@ public class ScalePanel extends JPanel public void doMousePressed(MouseEvent evt) { int x = evt.getX(); - int res = x/(int)av.getCharWidth() + av.getStartRes(); + int res = x/av.getCharWidth() + av.getStartRes(); if (! av.getColumnSelection().contains(res)) av.getColumnSelection().addElement(res);