[Libreoffice-commits] core.git: vcl/quartz

Khaled Hosny khaledhosny at eglug.org
Wed Nov 2 21:51:59 UTC 2016


 vcl/quartz/ctfonts.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8cef9b4dbafdebc0566d6d7f715f27f978ddfe5b
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Wed Nov 2 23:38:13 2016 +0200

    Fix GetGlyphBoundRect() on macOS
    
    The Y sign should be reversed to match VCL, apparently it was either
    unused on macOS before CommonSalLayout or it was wrong all along.
    
    This was the source of CppunitTest_svgio failure on macOS with
    CommonSalLayout.
    
    Change-Id: I3108aab7b6780c912e86e5591ca0f41ea437137b

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 948bfb5..11905c2 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -157,9 +157,9 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
     const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1 );
 
     rRect.Left()   = lrint( aCGRect.origin.x );
-    rRect.Top()    = lrint( aCGRect.origin.y );
+    rRect.Top()    = lrint(-aCGRect.origin.y );
     rRect.Right()  = lrint( aCGRect.origin.x + aCGRect.size.width );
-    rRect.Bottom() = lrint( aCGRect.origin.y + aCGRect.size.height );
+    rRect.Bottom() = lrint( aCGRect.origin.y - aCGRect.size.height );
     return true;
 }
 


More information about the Libreoffice-commits mailing list