drawinglayer/source/tools/emfphelperdata.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit ad4ee3bb3bf99c3b02ddca2318d39a1c0f2469a0 Author: Bartosz Kosiorek <gan...@poczta.onet.pl> AuthorDate: Thu Mar 19 23:20:44 2020 +0100 Commit: Bartosz Kosiorek <gan...@poczta.onet.pl> CommitDate: Fri Mar 20 08:21:53 2020 +0100 EMF+ tdf#124424 Add support for transparency to LinearGradient and blend points Change-Id: Ia1cabaef6aa01337581cb9359bdd1ae90a4ebd55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90767 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl> diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index f7c22c6831b6..c8e0d078be39 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -835,10 +835,11 @@ namespace emfplushelper // seems like SvgRadialGradientPrimitive2D needs doubled, inverted radius aBlendPoint = 2. * ( 1. - brush->blendPositions [i] ); } - aColor.setGreen( aStartColor.getGreen() * (1. - brush->blendFactors[i]) + aEndColor.getGreen() * brush->blendFactors[i] ); - aColor.setBlue ( aStartColor.getBlue() * (1. - brush->blendFactors[i]) + aEndColor.getBlue() * brush->blendFactors[i] ); - aColor.setRed ( aStartColor.getRed() * (1. - brush->blendFactors[i]) + aEndColor.getRed() * brush->blendFactors[i] ); - aVector.emplace_back(aBlendPoint, aColor, 1. ); + aColor.setGreen( aStartColor.getGreen() + brush->blendFactors[i] * ( aEndColor.getGreen() - aStartColor.getGreen() ) ); + aColor.setBlue ( aStartColor.getBlue() + brush->blendFactors[i] * ( aEndColor.getBlue() - aStartColor.getBlue() ) ); + aColor.setRed ( aStartColor.getRed() + brush->blendFactors[i] * ( aEndColor.getRed() - aStartColor.getRed() ) ); + const double aTransparency = brush->solidColor.GetTransparency() + brush->blendFactors[i] * ( brush->secondColor.GetTransparency() - brush->solidColor.GetTransparency() ); + aVector.emplace_back(aBlendPoint, aColor, (255.0 - aTransparency) / 255.0); } } else if (brush->colorblendPositions) @@ -860,7 +861,7 @@ namespace emfplushelper aBlendPoint = 2. * ( 1. - brush->colorblendPositions [i] ); } aColor = brush->colorblendColors[i].getBColor(); - aVector.emplace_back(aBlendPoint, aColor, 1. ); + aVector.emplace_back(aBlendPoint, aColor, (255 - brush->colorblendColors[i].GetTransparency()) / 255.0 ); } } else // ok, no extra points: just start and end _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits