diff options
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 24b5268493de..0fb20bb490cc 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -85,7 +85,7 @@ public: ~CoreTextStyle() override; void GetFontMetric( ImplFontMetricDataRef const & ); - bool GetGlyphBoundRect(const GlyphItem&, tools::Rectangle&) const; + bool GetGlyphBoundRect(const GlyphItem&, tools::Rectangle&); bool GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) const; CFMutableDictionaryRef GetStyleDict( void ) const { return mpStyleDict; } diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 6ceec8a0295d..65b3a85f5a43 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -137,8 +137,11 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) rxFontMetric->SetMinKashida(GetKashidaWidth()); } -bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) const +bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) { + if (GetCachedGlyphBoundRect(rGlyph.maGlyphId, rRect)) + return true; + CGGlyph nCGGlyph = rGlyph.maGlyphId; CTFontRef aCTFontRef = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName )); @@ -156,6 +159,7 @@ bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& long xMax = ceil(aCGRect.origin.x + aCGRect.size.width); long yMax = ceil(aCGRect.origin.y + aCGRect.size.height); rRect = tools::Rectangle(xMin, -yMax, xMax, -yMin); + CacheGlyphBoundRect(rGlyph.maGlyphId, rRect); return true; } |