diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-11-20 16:15:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-11-20 19:04:36 +0100 |
commit | 81b0d5393ca4cf2ff0954e53b05928cde047c2e0 (patch) | |
tree | a321e67d3426e66d1a6a9a33436e92400377e161 /svx/source | |
parent | d1bf39a78ed239d4493f0470ca937852265e79d6 (diff) |
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.
Change-Id: Ie7aebe77ad9ac776dd27fc50538a5045200c8010
Reviewed-on: https://gerrit.libreoffice.org/83307
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 1cc2b8a1df37..ff3b839710b2 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -54,6 +54,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> @@ -356,6 +357,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 |