1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

CoreGraphics: Fix incorrect behaviour of non-solid-colour text fills

Previously, filling a string containing a space or other non-rendered
character with a gradient would end up filling the entire clip region.

The correct behaviour is to completely skip filling any empty paths.
This commit is contained in:
reuk 2024-11-18 12:18:24 +00:00
parent 5737c42ccf
commit 01bfa98827

View file

@ -867,6 +867,10 @@ void CoreGraphicsContext::drawGlyphs (Span<const uint16_t> glyphs,
Path p;
auto& f = state->font;
f.getTypefacePtr()->getOutlineForGlyph (f.getMetricsKind(), glyph, p);
if (p.isEmpty())
continue;
const auto scale = f.getHeight();
fillPath (p, AffineTransform::scale (scale * f.getHorizontalScale(), scale).translated (positions[index]).followedBy (transform));
}