From d7741c79bfa6edfc16a431a56e6ed56b464ef13a Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 10 Feb 2015 17:08:51 +0000 Subject: [PATCH] JAL-1640 make font-size changes modify grid size again --- src/jalview/gui/AlignViewport.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index a89174a..c4ac828 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -466,10 +466,8 @@ public class AlignViewport extends AlignmentViewport implements boolean validCharWidth; /** - * DOCUMENT ME! - * - * @param f - * DOCUMENT ME! + * update view settings with the given font. You may need to call + * alignPanel.fontChanged to update the layout geometry */ public void setFont(Font f) { @@ -480,15 +478,8 @@ public class AlignViewport extends AlignmentViewport implements java.awt.FontMetrics fm = c.getFontMetrics(font); int w = viewStyle.getCharWidth(), ww = fm.charWidth('M'), h = viewStyle .getCharHeight(); - // only update width/height if the new font won't fit - if (h < fm.getHeight()) - { - setCharHeight(fm.getHeight()); - } - if (w < ww) - { - setCharWidth(ww); - } + setCharHeight(fm.getHeight()); + setCharWidth(ww); viewStyle.setFontName(font.getName()); viewStyle.setFontStyle(font.getStyle()); viewStyle.setFontSize(font.getSize()); -- 1.7.10.2