[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/coretext

Khaled Hosny khaledhosny at eglug.org
Tue Jul 16 08:53:57 PDT 2013


 vcl/coretext/ctlayout.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 48bcea3710f14091e2e4fd078a31f278bce0c196
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Mon Jul 15 11:32:30 2013 +0200

    fdo#66577: Cursor displaced in Web Layout
    
    Using lrint() helps a bit, but does not fix the issue entirely.
    
    Change-Id: Ib80e2c5a57d632f289e49322d3712c6321ae1ec2
    Reviewed-on: https://gerrit.libreoffice.org/4907
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/vcl/coretext/ctlayout.cxx b/vcl/coretext/ctlayout.cxx
index 632d6f5..437f7fc 100644
--- a/vcl/coretext/ctlayout.cxx
+++ b/vcl/coretext/ctlayout.cxx
@@ -341,7 +341,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int&
             // convert glyph details for VCL
             *(pGlyphIDs++) = pCGGlyphIdx[ nSubIndex ];
             if( pGlyphAdvances )
-                *(pGlyphAdvances++) = pCGGlyphAdvs[ nSubIndex ].width;
+                *(pGlyphAdvances++) = lrint(pCGGlyphAdvs[ nSubIndex ].width);
             if( pCharIndexes )
                 *(pCharIndexes++) = pCGGlyphStrIdx[ nSubIndex] + mnMinCharPos;
             if( pFallbackFonts )
@@ -406,7 +406,7 @@ long CTLayout::FillDXArray( sal_Int32* pDXArray ) const
             CTRunGetStringIndices( pGlyphRun, aFullRange, &aIndexVec[0] );
             for( int i = 0; i != nGlyphCount; ++i ) {
                 const int nRelIdx = aIndexVec[i];
-                pDXArray[ nRelIdx ] += aSizeVec[i].width;
+                pDXArray[ nRelIdx ] += lrint(aSizeVec[i].width);
             }
         }
     }
@@ -500,10 +500,10 @@ bool CTLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rVCLRect ) const
 
     CGContextRestoreGState( rAquaGraphics.mrContext );
 
-    rVCLRect.Left()   = aVclPos.x + aMacRect.origin.x;
-    rVCLRect.Right()  = aVclPos.x + (aMacRect.origin.x + aMacRect.size.width);
-    rVCLRect.Bottom() = aVclPos.x - (aMacRect.origin.y);
-    rVCLRect.Top()    = aVclPos.x - (aMacRect.origin.y + aMacRect.size.height);
+    rVCLRect.Left()   = aVclPos.x + lrint(aMacRect.origin.x);
+    rVCLRect.Right()  = aVclPos.x + lrint(aMacRect.origin.x + aMacRect.size.width);
+    rVCLRect.Bottom() = aVclPos.x - lrint(aMacRect.origin.y);
+    rVCLRect.Top()    = aVclPos.x - lrint(aMacRect.origin.y + aMacRect.size.height);
 
     return true;
 }


More information about the Libreoffice-commits mailing list