[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - drawinglayer/source
Armin Le Grand
Armin.Le.Grand at cib.de
Thu Jun 7 10:26:03 UTC 2018
drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit a3423a4efd016014158fdeec34e1f75960f8604a
Author: Armin Le Grand <Armin.Le.Grand at 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 <ci at libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
(cherry picked from commit aa5d7477e8e1e4bcd0e56496e745c3dc3b05c369)
Reviewed-on: https://gerrit.libreoffice.org/55398
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);
More information about the Libreoffice-commits
mailing list