svx/source/svdraw/svdotextdecomposition.cxx | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit 1eafe67eb2cfd23781ebc61ee830e79c56a315f0 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Nov 20 16:15:39 2019 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Feb 21 15:58:10 2020 +0100 svx: add rendering for semi-transparent shape text The color's alpha is normally lost when we roundtrip SvxColorItem's tools Color via TextSimplePortionPrimitive2D's basegfx::BColor. One way would be to add an extra transparency member to the primitive, like BackgroundColorPrimitive2D does that. However, a much easier way is to go via UnifiedTransparencePrimitive2D, that way we handle transparency in drawinglayer::impBufferDevice::paint(), rather than platform-specific code like CairoTextRender::DrawTextLayout() in the Linux case. (cherry picked from commit 81b0d5393ca4cf2ff0954e53b05928cde047c2e0) Conflicts: svx/CppunitTest_svx_unit.mk Change-Id: Ie7aebe77ad9ac776dd27fc50538a5045200c8010 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89179 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index e5e0ee273e11..7c479065c4ae 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -48,6 +48,7 @@ #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx> #include <drawinglayer/primitive2d/graphicprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> +#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <svx/unoapi.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> #include <editeng/outlobj.hxx> @@ -351,6 +352,14 @@ namespace aTextFillColor); } + if (aFontColor.GetTransparency() != 0) + { + // Handle semi-transparent text for both the decorated and simple case here. + pNewPrimitive = new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( + drawinglayer::primitive2d::Primitive2DContainer{ pNewPrimitive }, + aFontColor.GetTransparency() / 255.0); + } + if(rInfo.mbEndOfBullet) { // embed in TextHierarchyBulletPrimitive2D _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits