From: gmungoc Date: Mon, 27 Aug 2018 14:30:25 +0000 (+0100) Subject: JAL-3055 restore original deriveFont code for Java runtime X-Git-Tag: Release_2_11_4_0~45^2~18^2~456^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4dcc7fd17c9fb90ba1830f3d01d30cd232595652;p=jalview.git JAL-3055 restore original deriveFont code for Java runtime --- diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 4dd91da..8480a34 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -25,6 +25,7 @@ import jalview.analysis.CodingUtils; import jalview.analysis.Rna; import jalview.analysis.StructureFrequency; import jalview.api.AlignViewportI; +import jalview.bin.Jalview; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; @@ -669,9 +670,17 @@ public class AnnotationRenderer // scale only if the current font isn't already small enough fmScaling = charWidth; fmScaling /= fmWidth; - gg.setFont(ofont); - gg.transform( - AffineTransform.getScaleInstance(fmScaling, 1.0)); + if (Jalview.isJS()) + { + gg.setFont(ofont); + gg.transform(AffineTransform.getScaleInstance(fmScaling, + 1.0)); + } + else + { + g.setFont(ofont.deriveFont(AffineTransform + .getScaleInstance(fmScaling, 1.0))); + } // and update the label's width to reflect the scaling. fmWidth = charWidth; }