Kaydet (Commit) ee042661 authored tarafından Herbert Dürr's avatar Herbert Dürr

#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().
üst 77e79c41
...@@ -265,13 +265,7 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const ...@@ -265,13 +265,7 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const
CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y ); CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y );
// set the text color as fill color (see kCTForegroundColorFromContextAttributeName) // request an update of the to-be-changed window area
CGContextSetFillColor( rAquaGraphics.mrContext, rAquaGraphics.maTextColor.AsArray() );
// draw the text
CTLineDraw( mpCTLine, rAquaGraphics.mrContext );
// request an update of the changed window area
if( rAquaGraphics.IsWindowGraphics() ) if( rAquaGraphics.IsWindowGraphics() )
{ {
const CGRect aInkRect = CTLineGetImageBounds( mpCTLine, rAquaGraphics.mrContext ); const CGRect aInkRect = CTLineGetImageBounds( mpCTLine, rAquaGraphics.mrContext );
...@@ -279,6 +273,12 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const ...@@ -279,6 +273,12 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const
rAquaGraphics.RefreshRect( aRefreshRect ); 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 // restore the original graphic context transformations
CGContextRestoreGState( rAquaGraphics.mrContext ); CGContextRestoreGState( rAquaGraphics.mrContext );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment