openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1629919 - /openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx
Date Tue, 07 Oct 2014 16:20:59 GMT
Author: alg
Date: Tue Oct  7 16:20:59 2014
New Revision: 1629919

URL: http://svn.apache.org/r1629919
Log:
i125698 Finetuned visualization for aligned AAed areas

Modified:
    openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx

Modified: openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx?rev=1629919&r1=1629918&r2=1629919&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx (original)
+++ openoffice/trunk/main/sw/source/core/layout/paintfrm.cxx Tue Oct  7 16:20:59 2014
@@ -1651,13 +1651,34 @@ bool MA_FASTCALL DrawFillAttributes(
             !basegfx::fTools::equalZero(aPaintRange.getWidth()) && 
             !basegfx::fTools::equalZero(aPaintRange.getHeight()))
         {
-            //UUUU need to expand for correct AAed and non-AAed visualization as primitive;
move
-            // bounds to half-(logical)pixel bounds and add a width/height of one pixel that
is missing
-            // from SwRect/Rectangle integer handling
-            const basegfx::B2DVector aSingleUnit(rOut.GetInverseViewTransformation() * basegfx::B2DVector(0.5,
0.5));
+            const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
 
-            aPaintRange.expand(aPaintRange.getMinimum() - (aSingleUnit * 0.5));
-            aPaintRange.expand(aPaintRange.getMaximum() + (aSingleUnit * 1.5));
+            //UUUU need to expand for correct AAed and non-AAed visualization as primitive.
+            // This must probably be removed again when we will be able to get all Writer
visualization
+            // as primitives and Writer prepares all it's stuff in high precision coordinates
(also
+            // needs to avoid moving boundaries around to better show overlapping stuff...)
+            if(aSvtOptionsDrawinglayer.IsAntiAliasing())
+            {
+                // if AAed in principle expand by 0.5 in all directions. Since painting edges
of
+                // AAed regions does not add to no transparence (0.5 opacity covered by 0.5
opacity
+                // is not full opacity but 0.75 opacity) we need some overlap here to avoid
paint
+                // artifacts. Checked experimentally - a little bit more in Y is needed,
probably
+                // due to still existing integer alignment and cruncing in writer.
+                static double fExpandX = 0.55;
+                static double fExpandY = 0.70;
+                const basegfx::B2DVector aSingleUnit(rOut.GetInverseViewTransformation()
* basegfx::B2DVector(fExpandX, fExpandY));
+
+                aPaintRange.expand(aPaintRange.getMinimum() - aSingleUnit);
+                aPaintRange.expand(aPaintRange.getMaximum() + aSingleUnit);
+            }
+            else
+            {
+                // if not AAed expand by one unit to bottom right due to the missing unit
+                // from SwRect/Rectangle integer handling
+                const basegfx::B2DVector aSingleUnit(rOut.GetInverseViewTransformation()
* basegfx::B2DVector(1.0, 1.0));
+
+                aPaintRange.expand(aPaintRange.getMaximum() + aSingleUnit);
+            }
 
             const basegfx::B2DRange aDefineRange(
                 rOriginalLayoutRect.Left(),



Mime
View raw message