mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
CoreGraphics: Added convertToPointFloat() helper
This commit is contained in:
parent
ec43c7f61c
commit
a747f7c47f
2 changed files with 8 additions and 2 deletions
|
|
@ -47,6 +47,12 @@ namespace
|
|||
return CGRectMake ((CGFloat) r.getX(), (CGFloat) r.getY(), (CGFloat) r.getWidth(), (CGFloat) r.getHeight());
|
||||
}
|
||||
|
||||
template <class PointType>
|
||||
Point<float> convertToPointFloat (PointType p) noexcept
|
||||
{
|
||||
return { (float) p.x, (float) p.y };
|
||||
}
|
||||
|
||||
template <typename PointType>
|
||||
CGPoint convertToCGPoint (PointType p) noexcept
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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> ((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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue