diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-06 14:04:59 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-07 01:13:34 +0300 |
commit | ffd4c2e40eca03445ab2c77468f661d691adc31e (patch) | |
tree | 84ef2aa550da5043e1a37d1204412597656f053a | |
parent | cbb8b5db244c83062a02fb241a4a70dad381704b (diff) |
Try calling RefreshRect() in DrawText() like in the ATSUI code
But like there, I don't know if it actually is needed or not.
Change-Id: I25bf5d8cf160b56ee4deb47ab9774313eb9590c8
-rw-r--r-- | vcl/coretext/salcoretextlayout.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vcl/coretext/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx index 7b1ee3a193ee..c82381b50528 100644 --- a/vcl/coretext/salcoretextlayout.cxx +++ b/vcl/coretext/salcoretextlayout.cxx @@ -20,6 +20,7 @@ #include <iostream> #include <iomanip> +#include "quartz/utils.h" #include "coretext/common.h" #include "coretext/salcoretextstyle.hxx" @@ -187,6 +188,29 @@ void CoreTextLayout::DrawText( SalGraphics& rGraphics ) const CGContextTranslateCTM(gr.mrContext, pos.X(), pos.Y()); CGContextShowGlyphs(gr.mrContext, mpGlyphs, mnGlyphCount); +#ifndef IOS + // Request an update of the changed window area. Like in the ATSUI + // code, I am not sure if this is actually necessary. Once this + // seems to work fine otherwise, let's try removing this. + if( gr.IsWindowGraphics() ) + { + CGRect drawRect = CTLineGetImageBounds( mpLine, gr.mrContext ); + SAL_INFO( "vcl.coretext.layout", "drawRect=" << drawRect ); + if( !CGRectIsNull( drawRect ) ) { +#if 1 + // For kicks, try the same silly (?) enlarging of the + // rectangle as in the ATSUI code + drawRect.origin.y -= drawRect.size.height; + drawRect.size.height += 2*drawRect.size.height; + SAL_INFO( "vcl.coretext.layout", "after enlarging drawRect=" << drawRect ); +#endif + drawRect = CGContextConvertRectToDeviceSpace( gr.mrContext, drawRect ); + SAL_INFO( "vcl.coretext.layout", "after convert: drawRect=" << drawRect ); + gr.RefreshRect( drawRect ); + } + } +#endif + // restore the original graphic context transformations CGContextRestoreGState( gr.mrContext ); } |