[Libreoffice-commits] core.git: 2 commits - configure.ac vcl/coretext

Tor Lillqvist tml at iki.fi
Wed Jun 19 05:15:53 PDT 2013


 configure.ac              |    2 +-
 vcl/coretext/ctlayout.cxx |   39 ++++++++++++++++++++++++++++++---------
 2 files changed, 31 insertions(+), 10 deletions(-)

New commits:
commit b9c46f46cebc0ebed5a91f8fbb9d0a01366f1f77
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jun 19 15:12:30 2013 +0300

    fdo#63616: Fix GetBoundRect for rotated text in CoreText backend
    
    Change-Id: I8c9ee84afd71481c2c6b002265b86e048f369f5c

diff --git a/vcl/coretext/ctlayout.cxx b/vcl/coretext/ctlayout.cxx
index e2a118b..1e89a39 100644
--- a/vcl/coretext/ctlayout.cxx
+++ b/vcl/coretext/ctlayout.cxx
@@ -433,18 +433,39 @@ bool CTLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rVCLRect ) const
         return false;
 #endif
 
+    CGContextSaveGState( rAquaGraphics.mrContext );
+    CGContextScaleCTM( rAquaGraphics.mrContext, 1.0, -1.0 );
+    CGContextSetShouldAntialias( rAquaGraphics.mrContext, !rAquaGraphics.mbNonAntialiasedText );
+
+    const Point aVclPos = GetDrawPosition( Point(mnBaseAdv,0) );
+    CGPoint aTextPos = { (CGFloat) +aVclPos.X(), (CGFloat) -aVclPos.Y() };
+
+    if( mpTextStyle->mfFontRotation != 0.0 )
+    {
+        const CGFloat fRadians = mpTextStyle->mfFontRotation;
+        CGContextRotateCTM( rAquaGraphics.mrContext, +fRadians );
+
+        const CGAffineTransform aInvMatrix = CGAffineTransformMakeRotation( -fRadians );
+        aTextPos = CGPointApplyAffineTransform( aTextPos, aInvMatrix );
+    }
+
+    CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y );
     CGRect aMacRect = CTLineGetImageBounds( mpCTLine, rAquaGraphics.mrContext );
-    CGPoint aMacPos = CGContextGetTextPosition( rAquaGraphics.mrContext );
-    aMacRect.origin.x -= aMacPos.x;
-    aMacRect.origin.y -= aMacPos.y;
 
-    const Point aPos = GetDrawPosition( Point(mnBaseAdv, 0) );
+    if( mpTextStyle->mfFontRotation != 0.0 )
+    {
+        const CGFloat fRadians = mpTextStyle->mfFontRotation;
+        const CGAffineTransform aMatrix = CGAffineTransformMakeRotation( +fRadians );
+        aMacRect = CGRectApplyAffineTransform( aMacRect, aMatrix );
+    }
+
+    CGContextRestoreGState( rAquaGraphics.mrContext );
+
+    rVCLRect.Left()   = aVclPos.X() + aMacRect.origin.x;
+    rVCLRect.Right()  = aVclPos.X() + (aMacRect.origin.x + aMacRect.size.width);
+    rVCLRect.Bottom() = aVclPos.Y() - (aMacRect.origin.y);
+    rVCLRect.Top()    = aVclPos.Y() - (aMacRect.origin.y + aMacRect.size.height);
 
-    // CoreText top-bottom are vertically flipped from a VCL aspect
-    rVCLRect.Left()   = aPos.X() + aMacRect.origin.x;
-    rVCLRect.Right()  = aPos.X() + (aMacRect.origin.x + aMacRect.size.width);
-    rVCLRect.Bottom() = aPos.Y() - aMacRect.origin.y;
-    rVCLRect.Top()    = aPos.Y() - (aMacRect.origin.y + aMacRect.size.height);
     return true;
 }
 
commit a662d427108d781122f979392ce544017d14fc17
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jun 19 13:36:27 2013 +0300

    Don't use -d32 when building 64-bit code
    
    Change-Id: I83a960cebb8347170a08d2fda7ed11050b8c4229

diff --git a/configure.ac b/configure.ac
index 3f36bca..51a534f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6253,7 +6253,7 @@ if test "$SOLAR_JAVA" != ""; then
         fi
         JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
         JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
-    elif test "$_os" = "Darwin"; then
+    elif test $_os = Darwin -a "$BITNESS_OVERRIDE" = ""; then
         dnl HACK:  There currently is only a 32 bit version of LibreOffice for Mac OS X,
         dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
         dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:


More information about the Libreoffice-commits mailing list