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 | |
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')
-rw-r--r-- | svx/source/sdr/contact/viewcontactofgraphic.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 2 |
3 files changed, 5 insertions, 5 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 diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index e11d1b54528b..925b714cb5ff 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1046,7 +1046,7 @@ void SdrGrafObj::ImpSetAttrToGrafInfo() aGrafInfo.SetChannelG( rSet.Get( SDRATTR_GRAFGREEN ).GetValue() ); aGrafInfo.SetChannelB( rSet.Get( SDRATTR_GRAFBLUE ).GetValue() ); aGrafInfo.SetGamma( rSet.Get( SDRATTR_GRAFGAMMA ).GetValue() * 0.01 ); - aGrafInfo.SetTransparency( static_cast<sal_uInt8>(FRound( std::min( nTrans, sal_uInt16(100) ) * 2.55 )) ); + aGrafInfo.SetAlpha( 255 - static_cast<sal_uInt8>(FRound( std::min( nTrans, sal_uInt16(100) ) * 2.55 )) ); aGrafInfo.SetInvert( rSet.Get( SDRATTR_GRAFINVERT ).GetValue() ); aGrafInfo.SetDrawMode( rSet.Get( SDRATTR_GRAFMODE ).GetValue() ); aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() ); |