diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-13 08:47:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-13 14:36:27 +0100 |
commit | 502f6372aeb6689f3d61cea7a77b2e8db160d767 (patch) | |
tree | eabad6b878cd69d0f61af04259935d7efcd23830 /drawinglayer | |
parent | f3d39d9a8502ae678a4eedfb73d1efc49104d7dc (diff) |
transparency->alpha in GraphicAttr
Change-Id: I1fe9311871724ff8b7b8960f5dba6e890198565c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109211
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/graphicprimitive2d.cxx | 6 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx index 2f029914bf19..40549e6eface 100644 --- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx @@ -33,7 +33,7 @@ namespace drawinglayer::primitive2d void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D&) const { - if (255 == getGraphicAttr().GetTransparency()) + if (0 == getGraphicAttr().GetAlpha()) { // content is invisible, done return; @@ -70,7 +70,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, aSuppressGraphicAttr.SetCrop(0, 0, 0, 0); aSuppressGraphicAttr.SetRotation(0_deg10); aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE); - aSuppressGraphicAttr.SetTransparency(0); + aSuppressGraphicAttr.SetAlpha(255); const GraphicObject& rGraphicObject = getGraphicObject(); Graphic aTransformedGraphic(rGraphicObject.GetGraphic()); @@ -134,7 +134,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, { // check for transparency const double fTransparency( - std::clamp(getGraphicAttr().GetTransparency() * (1.0 / 255.0), 0.0, 1.0)); + std::clamp((255 - getGraphicAttr().GetAlpha()) * (1.0 / 255.0), 0.0, 1.0)); if (!basegfx::fTools::equalZero(fTransparency)) { diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 8bf1d3977d79..dba886f1cc32 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1069,7 +1069,7 @@ void VclMetafileProcessor2D::processGraphicPrimitive2D( // object transformation, thus aCurrentRect *is* the clip region while aCropRect is the expanded, // uncropped region. Thus, correct order is aCropRect, aCurrentRect mpPDFExtOutDevData->EndGroup(rGraphicPrimitive.getGraphicObject().GetGraphic(), - rAttr.GetTransparency(), aCropRect, aCurrentRect); + 255 - rAttr.GetAlpha(), aCropRect, aCurrentRect); } void VclMetafileProcessor2D::processControlPrimitive2D( |