mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
macOS: Replaced a deprecated glyph drawing function
This commit is contained in:
parent
a5e5831ea0
commit
c528af5976
1 changed files with 6 additions and 16 deletions
|
|
@ -639,19 +639,13 @@ void CoreGraphicsContext::drawGlyph (int glyphNumber, const AffineTransform& tra
|
|||
{
|
||||
if (state->fontRef != nullptr && state->fillType.isColour())
|
||||
{
|
||||
#if JUCE_CLANG && ! (defined (MAC_OS_X_VERSION_10_16) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_16)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#define JUCE_DEPRECATION_IGNORED 1
|
||||
#endif
|
||||
|
||||
if (transform.isOnlyTranslation())
|
||||
{
|
||||
CGContextSetTextMatrix (context, state->fontTransform); // have to set this each time, as it's not saved as part of the state
|
||||
|
||||
auto g = (CGGlyph) glyphNumber;
|
||||
CGContextShowGlyphsAtPoint (context, transform.getTranslationX(),
|
||||
flipHeight - roundToInt (transform.getTranslationY()), &g, 1);
|
||||
CGGlyph glyphs[1] = { (CGGlyph) glyphNumber };
|
||||
CGPoint positions[1] = { { transform.getTranslationX(), flipHeight - roundToInt (transform.getTranslationY()) } };
|
||||
CGContextShowGlyphsAtPositions (context, glyphs, positions, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -663,16 +657,12 @@ void CoreGraphicsContext::drawGlyph (int glyphNumber, const AffineTransform& tra
|
|||
t.d = -t.d;
|
||||
CGContextSetTextMatrix (context, t);
|
||||
|
||||
auto g = (CGGlyph) glyphNumber;
|
||||
CGContextShowGlyphsAtPoint (context, 0, 0, &g, 1);
|
||||
CGGlyph glyphs[1] = { (CGGlyph) glyphNumber };
|
||||
CGPoint positions[1] = { { 0.0f, 0.0f } };
|
||||
CGContextShowGlyphsAtPositions (context, glyphs, positions, 1);
|
||||
|
||||
CGContextRestoreGState (context);
|
||||
}
|
||||
|
||||
#if JUCE_DEPRECATION_IGNORED
|
||||
#pragma clang diagnostic pop
|
||||
#undef JUCE_DEPRECATION_IGNORED
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue