[Libreoffice-commits] core.git: vcl/coretext

tsahi glik tsahi.glik at cloudon.com
Thu Sep 12 08:33:40 PDT 2013


 vcl/coretext/salgdi2.cxx |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit 3ea6e49f581ef9d28cc2c3374426b5fac8627802
Author: tsahi glik <tsahi.glik at cloudon.com>
Date:   Fri Aug 30 13:27:32 2013 -0700

    iOS fix clip area in coretext context
    
    Change-Id: Ibaef9701ad4ba1bda1068c0dfa34f83c09a4e409
    Reviewed-on: https://gerrit.libreoffice.org/5711
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vcl/coretext/salgdi2.cxx b/vcl/coretext/salgdi2.cxx
index 819d9f9..cf7e7e1 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 );


More information about the Libreoffice-commits mailing list