diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-09-23 16:55:19 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-09-23 17:48:59 +0200 |
commit | 00fa364a2403dc23a786d3f91fde06e10b3a4a9a (patch) | |
tree | cae255dd2a5e44fb6e9b41e2d32f2b3650e76c8d /svx/source/table/viewcontactoftableobj.cxx | |
parent | c8d66a4d53acf1b0c0de45335015b72ee72cd0fd (diff) |
Related: tdf#144091 svx: fix interaction of transp cell fill and transp shadow
This is a follow-up to commit 37a52d30bbfcf1d073779b50139c4dafa507be4b
(tdf#144091 svx: fix unwanted blur of shadow from table cell fill,
2021-09-20), where it turned out that the original bugdoc was just a
special case of almost full transparency (80%), that's why avoiding the
blur fixed the problem.
A more general approach instead is to multiply the alpha or the cell
fill of table shapes and the alpha of the shadow itself. The end result
is the same (80% transparency) for the first bugdoc, but this gives back
the blur on the second bugdoc.
Change-Id: I63560e3a73473c70157ecee8365ec7154217f269
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122532
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx/source/table/viewcontactoftableobj.cxx')
-rw-r--r-- | svx/source/table/viewcontactoftableobj.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index ae5b9ef9313c..39762d727089 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -40,6 +40,7 @@ #include <svx/sdooitm.hxx> #include <vcl/canvastools.hxx> #include <o3tl/unit_conversion.hxx> +#include <svx/xfltrit.hxx> #include <cell.hxx> #include "tablelayouter.hxx" @@ -325,14 +326,21 @@ namespace sdr::contact aRetval.append(xCellReference); } - // Create cell primitive without text and blur. + // Create cell primitive without text. aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( rCellItemSet, nullptr); rtl::Reference pCellReference = new drawinglayer::primitive2d::SdrCellPrimitive2D( aCellMatrix, aAttribute); - pCellReference->setExcludeFromBlur(true); + + sal_uInt16 nTransparence( + rCellItemSet.Get(XATTR_FILLTRANSPARENCE).GetValue()); + if (nTransparence != 0) + { + pCellReference->setTransparenceForShadow(nTransparence); + } + const drawinglayer::primitive2d::Primitive2DReference xCellReference(pCellReference); aRetvalForShadow.append(xCellReference); @@ -384,8 +392,7 @@ namespace sdr::contact aTransform, drawinglayer::primitive2d::Primitive2DContainer(aCellBorderPrimitives))); - // Borders are always the same for shadow as well, and implicitly included - // in blur. + // Borders are always the same for shadow as well. aRetvalForShadow.append(new drawinglayer::primitive2d::TransformPrimitive2D( aTransform, std::move(aCellBorderPrimitives))); } |