From 4c48de44ad933ef6dd19777b3ebf1a51db5e14e3 Mon Sep 17 00:00:00 2001 From: A_GAN Date: Sun, 17 May 2020 00:51:09 +0200 Subject: Add blur attributies and definitons into shadow classes and properities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I365f4bcfc8d772ea77cec1e4ce139b9fc16d9d7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95000 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- drawinglayer/source/attribute/sdrshadowattribute.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx index 01ff66162ea5..9e379acaae28 100644 --- a/drawinglayer/source/attribute/sdrshadowattribute.cxx +++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx @@ -32,16 +32,19 @@ namespace drawinglayer::attribute basegfx::B2DVector maOffset; // shadow offset 1/100th mm basegfx::B2DVector maSize; // [0.0 .. 2.0] double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. + sal_Int32 mnBlur; // [0 .. 180], radius of the blur basegfx::BColor maColor; // color of shadow ImpSdrShadowAttribute( const basegfx::B2DVector& rOffset, const basegfx::B2DVector& rSize, double fTransparence, + sal_Int32 nBlur, const basegfx::BColor& rColor) : maOffset(rOffset), maSize(rSize), mfTransparence(fTransparence), + mnBlur(nBlur), maColor(rColor) { } @@ -50,6 +53,7 @@ namespace drawinglayer::attribute : maOffset(basegfx::B2DVector()), maSize(basegfx::B2DVector()), mfTransparence(0.0), + mnBlur(0), maColor(basegfx::BColor()) { } @@ -58,6 +62,7 @@ namespace drawinglayer::attribute const basegfx::B2DVector& getOffset() const { return maOffset; } const basegfx::B2DVector& getSize() const { return maSize; } double getTransparence() const { return mfTransparence; } + sal_Int32 getBlur() const { return mnBlur; } const basegfx::BColor& getColor() const { return maColor; } bool operator==(const ImpSdrShadowAttribute& rCandidate) const @@ -65,6 +70,7 @@ namespace drawinglayer::attribute return (getOffset() == rCandidate.getOffset() && getSize() == rCandidate.getSize() && getTransparence() == rCandidate.getTransparence() + && getBlur() == rCandidate.getBlur() && getColor() == rCandidate.getColor()); } }; @@ -80,9 +86,10 @@ namespace drawinglayer::attribute const basegfx::B2DVector& rOffset, const basegfx::B2DVector& rSize, double fTransparence, + sal_Int32 nBlur, const basegfx::BColor& rColor) : mpSdrShadowAttribute(ImpSdrShadowAttribute( - rOffset, rSize, fTransparence, rColor)) + rOffset, rSize, fTransparence,nBlur, rColor)) { } @@ -130,6 +137,11 @@ namespace drawinglayer::attribute return mpSdrShadowAttribute->getTransparence(); } + sal_Int32 SdrShadowAttribute::getBlur() const + { + return mpSdrShadowAttribute->getBlur(); + } + const basegfx::BColor& SdrShadowAttribute::getColor() const { return mpSdrShadowAttribute->getColor(); -- cgit