From 4dcc7fd17c9fb90ba1830f3d01d30cd232595652 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 27 Aug 2018 15:30:25 +0100 Subject: [PATCH] JAL-3055 restore original deriveFont code for Java runtime --- src/jalview/renderer/AnnotationRenderer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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; } -- 1.7.10.2