mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
CoreGraphicsContext: Use CopyableHeapBlock for glyph positions
This commit is contained in:
parent
67fa9b11cd
commit
44e2d0343b
1 changed files with 9 additions and 10 deletions
|
|
@ -838,21 +838,20 @@ void CoreGraphicsContext::drawGlyphs (Span<const uint16_t> glyphs,
|
|||
flip();
|
||||
applyTransform (AffineTransform::scale (1.0f, -1.0f).followedBy (transform));
|
||||
|
||||
std::vector<CGPoint> pos (glyphs.size());
|
||||
CopyableHeapBlock<CGPoint> pos (glyphs.size());
|
||||
std::transform (positions.begin(), positions.end(), pos.begin(), [scale] (const auto& p) { return CGPointMake (p.x / scale, -p.y); });
|
||||
|
||||
CTFontDrawGlyphs (state->fontRef.get(), glyphs.data(), pos.data(), glyphs.size(), context.get());
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
for (const auto [index, glyph] : enumerate (glyphs, size_t{}))
|
||||
{
|
||||
for (const auto [index, glyph] : enumerate (glyphs, size_t{}))
|
||||
{
|
||||
Path p;
|
||||
auto& f = state->font;
|
||||
f.getTypefacePtr()->getOutlineForGlyph (f.getMetricsKind(), glyph, p);
|
||||
const auto scale = f.getHeight();
|
||||
fillPath (p, AffineTransform::scale (scale * f.getHorizontalScale(), scale).translated (positions[index]).followedBy (transform));
|
||||
}
|
||||
Path p;
|
||||
auto& f = state->font;
|
||||
f.getTypefacePtr()->getOutlineForGlyph (f.getMetricsKind(), glyph, p);
|
||||
const auto scale = f.getHeight();
|
||||
fillPath (p, AffineTransform::scale (scale * f.getHorizontalScale(), scale).translated (positions[index]).followedBy (transform));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue