summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-10-07 16:20:59 +0000
committerArmin Le Grand <alg@apache.org>2014-10-07 16:20:59 +0000
commitf4d179a8f647336b27098ebb2e0418b22b3ba44e (patch)
tree1f04b7735a30fd6efe4abc93cbacb12625294f7b
parent09ab75fa36e15ce7de24900d374a6f481f7bfce2 (diff)
i125698 Finetuned visualization for aligned AAed areas
Notes
-rw-r--r--sw/source/core/layout/paintfrm.cxx33
1 files changed, 27 insertions, 6 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9ff50d065195..3f2d6aabf1c3 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -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(),