diff options
Diffstat (limited to 'src/jogl/classes/jogamp')
3 files changed, 6 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index ae9c43ec5..3cd9ab7c1 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -53,6 +53,7 @@ class TypecastFont implements Font { private final int cmapentries; private final IntObjectHashMap char2Glyph; private final TypecastHMetrics metrics; + private final float[] tmpV3 = new float[3]; // FIXME: Add cache size to limit memory usage ?? public TypecastFont(final OTFontCollection fontset) { @@ -260,7 +261,7 @@ class TypecastFont implements Font { final char character = string.charAt(i); if (character != ' ') { final Glyph glyph = getGlyph(character); - AABBox bbox = glyph.getBBox(pixelSize); + AABBox bbox = glyph.getBBox(pixelSize, tmpV3); height = (int)Math.ceil(Math.max(bbox.getHeight(), height)); } } diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java index 82971848e..b0e283278 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java @@ -188,10 +188,10 @@ public class TypecastGlyph implements Font.Glyph { } @Override - public final AABBox getBBox(float pixelSize) { + public final AABBox getBBox(float pixelSize, float[] tmpV3) { final float size = getScale(pixelSize); AABBox newBox = getBBox().clone(); - newBox.scale(size); + newBox.scale(size, tmpV3); return newBox; } diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java index 7efad5fb0..4064e6463 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java @@ -82,9 +82,9 @@ class TypecastHMetrics implements Metrics { return pixelSize * unitsPerEM_Inv; } @Override - public final AABBox getBBox(float pixelSize) { + public final AABBox getBBox(float pixelSize, float[] tmpV3) { AABBox res = new AABBox(bbox.getLow(), bbox.getHigh()); - res.scale(getScale(pixelSize)); + res.scale(getScale(pixelSize), tmpV3); return res; } }
\ No newline at end of file |