diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h b/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h index d4fa0c3cb5..93ad32f82c 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h @@ -47,6 +47,12 @@ namespace return CGRectMake ((CGFloat) r.getX(), (CGFloat) r.getY(), (CGFloat) r.getWidth(), (CGFloat) r.getHeight()); } + template + Point convertToPointFloat (PointType p) noexcept + { + return { (float) p.x, (float) p.y }; + } + template CGPoint convertToCGPoint (PointType p) noexcept { diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm index c54e0144c8..583dd916f0 100644 --- a/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -491,8 +491,8 @@ namespace CoreTextTypeLayout const Positions positions (run, (size_t) numGlyphs); for (CFIndex k = 0; k < numGlyphs; ++k) - glyphRun->glyphs.add (TextLayout::Glyph (glyphs.glyphs[k], Point ((float) positions.points[k].x, - (float) positions.points[k].y), + glyphRun->glyphs.add (TextLayout::Glyph (glyphs.glyphs[k], + convertToPointFloat (positions.points[k]), (float) advances.advances[k].width)); }