summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-09-04 18:10:22 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2023-09-06 11:23:26 +0200
commitd9cd1fe49bd4cf32257508adab11f16f7a4a88f1 (patch)
tree27061c421b33733c5ed4d5540667d7f0433690d4 /svx/source/sdr
parent1345619e0b3c2825c2ae50ada2c209d4ad8461ad (diff)
tdf#150557: svx: don't factor in transparence twice for cell shadows
multiplying child transparence with shadow alpha to get the correct shadow alpha has been incorrect maybe since commits: 7eb4f92ed90e13ce5cbf7286fae623770e71324c, e735ad1c57cddaf17d6ffc0cf15b5e14fa63c4ad In ShadowPrimitive2D::create2DDecomposition the shadow-casting primitive's alpha(mask) itself is already being taken into account. Therefore getting cell shadow alpha by multiplying child transparence with shadow alpha, has the effect of child transparence being applied twice for the table cell. Change-Id: I78f9bbfcb0694a86eabc061330677784e887b5dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156528 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de> (cherry picked from commit 98319164284c4a25d6a2313e6b8a35d244d94e91) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156591 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx13
1 files changed, 2 insertions, 11 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index b5df830d73fe..33e42efc6d23 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -850,25 +850,16 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const
Primitive2DContainer aRetval;
for (const auto& xChild : rContentForShadow)
{
- double fChildTransparence = 0.0;
- auto pChild = dynamic_cast<BufferedDecompositionPrimitive2D*>(xChild.get());
- if (pChild)
- {
- fChildTransparence = pChild->getTransparenceForShadow();
- fChildTransparence /= 100;
- }
aRetval.push_back(Primitive2DReference(
new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rShadow.getBlur(),
Primitive2DContainer({ xChild }))));
- if (rShadow.getTransparence() != 0.0 || fChildTransparence != 0.0)
+ if (rShadow.getTransparence() != 0.0)
{
Primitive2DContainer aTempContent{ aRetval.back() };
- double fChildAlpha = 1.0 - fChildTransparence;
double fShadowAlpha = 1.0 - rShadow.getTransparence();
- double fTransparence = 1.0 - fChildAlpha * fShadowAlpha;
aRetval.back() = Primitive2DReference(new UnifiedTransparencePrimitive2D(
- std::move(aTempContent), fTransparence));
+ std::move(aTempContent), fShadowAlpha));
}
}