drawinglayer/source/primitive2d/svggradientprimitive2d.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit aa5d7477e8e1e4bcd0e56496e745c3dc3b05c369
Author: Armin Le Grand <armin.le.gr...@cib.de>
Date:   Wed Jun 6 13:28:09 2018 +0200

    tdf#117949 Use small overlap for SVG gradient representation
    
    Change-Id: Idd55df31aa87cc40dbb15001479cdc79e918ac19
    Reviewed-on: https://gerrit.libreoffice.org/55376
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Armin Le Grand <armin.le.gr...@cib.de>

diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx 
b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index 0197b4199fb2..12eef36c16ac 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -915,14 +915,21 @@ namespace drawinglayer
                 // use color distance and discrete lengths to calculate step 
count
                 const sal_uInt32 
nSteps(calculateStepsForSvgGradient(getColorA(), getColorB(), fDelta, 
fDiscreteUnit));
 
+                // tdf#117949 Use a small amount of discrete overlap at the 
edges. Usually this
+                // should be exactly 0.0 and 1.0, but there were cases when 
this gets clipped
+                // against the mask polygon which got numerically problematic.
+                // This change is unnecessary in that respect, but avoids that 
numerical havoc
+                // by at the same time doing no real harm AFAIK
+                // TTTT: Remove again when clipping is fixed (!)
+
                 // prepare polygon in needed width at start position (with 
discrete overlap)
                 const basegfx::B2DPolygon aPolygon(
                     basegfx::utils::createPolygonFromRect(
                         basegfx::B2DRange(
                             getOffsetA() - fDiscreteUnit,
-                            0.0,
+                            -0.0001, // TTTT -> should be 0.0, see comment 
above
                             getOffsetA() + (fDelta / nSteps) + fDiscreteUnit,
-                            1.0)));
+                            1.0001))); // TTTT -> should be 1.0, see comment 
above
 
                 // prepare loop (inside to outside, [0.0 .. 1.0[)
                 double fUnitScale(0.0);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to