diff options
author | Herbert Dürr <hdu@apache.org> | 2014-06-02 11:30:49 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-03 09:51:27 +0100 |
commit | d2bbef3d3d6c7be096175ddbdb788ece5067f5fc (patch) | |
tree | bb5c120b6682bc85e0eac127f4fc990839395e97 /vcl/quartz/ctlayout.cxx | |
parent | bcc7086ebf447449489edef2adc3b158a0198cff (diff) |
Related: #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().
(cherry picked from commit ee042661b996fd00d5504caf4f4be60f77bf880f)
Conflicts:
vcl/aqua/source/gdi/ctlayout.cxx
Change-Id: I317a2068071a2f6d33f34c81e104e30beedc33db
Diffstat (limited to 'vcl/quartz/ctlayout.cxx')
-rw-r--r-- | vcl/quartz/ctlayout.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 8c42cc8537bb..46c55a394fac 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -356,14 +356,8 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons SAL_INFO( "vcl.ct", "CGContextSetTextPosition(" << rAquaGraphics.mrContext << "," << aTextPos << ")" ); CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y ); - // set the text color as fill color (see kCTForegroundColorFromContextAttributeName) - CGContextSetFillColor( rAquaGraphics.mrContext, rAquaGraphics.maTextColor.AsArray() ); - - SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << rAquaGraphics.mrContext << ")" ); - // draw the text - CTLineDraw( ctline, rAquaGraphics.mrContext ); #ifndef IOS - // 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 ); @@ -371,6 +365,14 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons rAquaGraphics.RefreshRect( aRefreshRect ); } #endif + + // set the text color as fill color (see kCTForegroundColorFromContextAttributeName) + CGContextSetFillColor( rAquaGraphics.mrContext, rAquaGraphics.maTextColor.AsArray() ); + + SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << rAquaGraphics.mrContext << ")" ); + // draw the text + CTLineDraw( ctline, rAquaGraphics.mrContext ); + // restore the original graphic context transformations SAL_INFO( "vcl.ct", "CGContextRestoreGState(" << rAquaGraphics.mrContext << ")" ); CGContextRestoreGState( rAquaGraphics.mrContext ); |