Author: hdu
Date: Mon Jun 2 11:30:49 2014
New Revision: 1599169
URL: http://svn.apache.org/r1599169
Log:
#i125020# fix the calculation of the text-update rectangle in CoreText
by doing the calculation before CTLineDraw() updates the text position.
Requesting the update early is possible because that update region is
not used until AquaSalInstance::Yield().
Modified:
openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx?rev=1599169&r1=1599168&r2=1599169&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/ctlayout.cxx Mon Jun 2 11:30:49
2014
@@ -265,13 +265,7 @@ void CTLayout::DrawText( SalGraphics& rG
CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x,
aTextPos.y );
- // set the text color as fill color (see
kCTForegroundColorFromContextAttributeName)
- CGContextSetFillColor( rAquaGraphics.mrContext,
rAquaGraphics.maTextColor.AsArray() );
-
- // draw the text
- CTLineDraw( mpCTLine, rAquaGraphics.mrContext );
-
- // request an update of the changed window area
+ // request an update of the to-be-changed window area
if( rAquaGraphics.IsWindowGraphics() )
{
const CGRect aInkRect = CTLineGetImageBounds( mpCTLine,
rAquaGraphics.mrContext );
@@ -279,6 +273,12 @@ void CTLayout::DrawText( SalGraphics& rG
rAquaGraphics.RefreshRect( aRefreshRect );
}
+ // set the text color as fill color (see
kCTForegroundColorFromContextAttributeName)
+ CGContextSetFillColor( rAquaGraphics.mrContext,
rAquaGraphics.maTextColor.AsArray() );
+
+ // draw the text
+ CTLineDraw( mpCTLine, rAquaGraphics.mrContext );
+
// restore the original graphic context transformations
CGContextRestoreGState( rAquaGraphics.mrContext );
}