[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - vcl/quartz

Herbert Dürr hdu at apache.org
Tue Jun 17 08:15:59 PDT 2014


 vcl/quartz/salgdiutils.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit c26817f9d576893e4b45b3432837b4f1c949098c
Author: Herbert Dürr <hdu at apache.org>
Date:   Mon Jun 2 11:47:23 2014 +0000

    Resolves: #i125020# fix rounding error in AquaSalGraphics::RefreshRect()
    
    Rounding left and width down can accumulate a rounding error of almost two in
    the calculation of right. The existing code compensates for this by increasing
    the width by two, but since left has been decremented by one to accommodate for
    antialiasing artifacts this compensation is one to few by itself and two to few
    when accounting for antialiasing artifacts on the right. Y-pos and height have
    the same problems and get the matching fix.
    
    (cherry picked from commit 073ec69fb970830d39c8700317ee74dbbdfd1fda)
    (cherry picked from commit ee9dd6c086f7bda615d5b28d3319a83ce1673607)
    
    Change-Id: Ia394859035d59c76c67b6b0d53ddc6cf88582bfe
    Reviewed-on: https://gerrit.libreoffice.org/9626
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index c251203..704fef5 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -182,10 +182,13 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh
     {
         // update a little more around the designated rectangle
         // this helps with antialiased rendering
+        // Rounding down x and width can accumulate a rounding error of up to 2
+        // The decrementing of x, the rounding error and the antialiasing border
+        // require that the width and the height need to be increased by four
         const Rectangle aVclRect(Point(static_cast<long int>(lX-1),
                     static_cast<long int>(lY-1) ),
-                 Size(  static_cast<long int>(lWidth+2),
-                    static_cast<long int>(lHeight+2) ) );
+                 Size(  static_cast<long int>(lWidth+4),
+                    static_cast<long int>(lHeight+4) ) );
         mpFrame->maInvalidRect.Union( aVclRect );
     }
 }


More information about the Libreoffice-commits mailing list