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 /svx/source/sdr | |
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 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofgraphic.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index e2e0b452a296..7450b25be1a4 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -296,13 +296,13 @@ namespace sdr::contact aLocalGrafInfo.SetChannelG(rItemSet.Get(SDRATTR_GRAFGREEN).GetValue()); aLocalGrafInfo.SetChannelB(rItemSet.Get(SDRATTR_GRAFBLUE).GetValue()); aLocalGrafInfo.SetGamma(rItemSet.Get(SDRATTR_GRAFGAMMA).GetValue() * 0.01); - aLocalGrafInfo.SetTransparency(static_cast<sal_uInt8>(::basegfx::fround(std::min(nTrans, sal_uInt16(100)) * 2.55))); + aLocalGrafInfo.SetAlpha(255 - static_cast<sal_uInt8>(::basegfx::fround(std::min(nTrans, sal_uInt16(100)) * 2.55))); aLocalGrafInfo.SetInvert(rItemSet.Get(SDRATTR_GRAFINVERT).GetValue()); aLocalGrafInfo.SetDrawMode(rItemSet.Get(SDRATTR_GRAFMODE).GetValue()); aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); // we have content if graphic is not completely transparent - const bool bHasContent(255L != aLocalGrafInfo.GetTransparency()); + const bool bHasContent(0 != aLocalGrafInfo.GetAlpha()); drawinglayer::attribute::SdrLineFillEffectsTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillEffectsTextAttribute( rItemSet, diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx index 36f34106e1fd..b0683ad2fd9e 100644 --- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx @@ -46,7 +46,7 @@ void SdrGrafPrimitive2D::create2DDecomposition( } // add graphic content - if (255 != getGraphicAttr().GetTransparency()) + if (0 != getGraphicAttr().GetAlpha()) { // standard graphic fill const Primitive2DReference xGraphicContentPrimitive( @@ -154,7 +154,7 @@ bool SdrGrafPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const bool SdrGrafPrimitive2D::isTransparent() const { - return ((0 != getGraphicAttr().GetTransparency()) || (getGraphicObject().IsTransparent())); + return ((255 != getGraphicAttr().GetAlpha()) || (getGraphicObject().IsTransparent())); } // provide unique ID |