diff options
author | tsahi glik <tsahi.glik@cloudon.com> | 2013-08-30 13:27:32 -0700 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-09-12 15:33:17 +0000 |
commit | 3ea6e49f581ef9d28cc2c3374426b5fac8627802 (patch) | |
tree | 3a33259aa6cc531ec020d39ad0af888b7ac4f671 /vcl/coretext | |
parent | e955030c0748b793fb5ff658dff713db4e621c41 (diff) |
iOS fix clip area in coretext context
Change-Id: Ibaef9701ad4ba1bda1068c0dfa34f83c09a4e409
Reviewed-on: https://gerrit.libreoffice.org/5711
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/coretext')
-rw-r--r-- | vcl/coretext/salgdi2.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vcl/coretext/salgdi2.cxx b/vcl/coretext/salgdi2.cxx index 819d9f9d4693..cf7e7e1a3f37 100644 --- a/vcl/coretext/salgdi2.cxx +++ b/vcl/coretext/salgdi2.cxx @@ -873,6 +873,35 @@ bool SvpSalGraphics::CheckContext() CGContextScaleCTM( mrContext, 1, -1 ); } + + if (mrContext) + { + RectangleVector aRectangles; + m_aClipRegion.GetRegionRectangles(aRectangles); + + CGContextBeginPath( mrContext ); + + for(RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); aRectIter++) + { + const long nW(aRectIter->Right() - aRectIter->Left() + 1); // uses +1 logic in original + + if(nW) + { + const long nH(aRectIter->Bottom() - aRectIter->Top() + 1); // uses +1 logic in original + + if(nH) + { + CGRect aRect = {{ (CGFloat) aRectIter->Left(), (CGFloat) aRectIter->Top() }, { (CGFloat) nW, (CGFloat) nH }}; + CGContextAddRect( mrContext, aRect ); + } + } + } + + CGContextClip(mrContext); + + } + + SAL_INFO( "vcl.ios", "CheckContext: context=" << mrContext ); return ( mrContext != NULL ); |