diff options
Diffstat (limited to 'svx')
3 files changed, 28 insertions, 10 deletions
diff --git a/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx index 6ca417d340c5..aaa93af94595 100644 --- a/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx @@ -47,6 +47,8 @@ namespace drawinglayer // making exceptions with shadow generation bool mb3DShape : 1; + basegfx::B2DHomMatrix maTransform; + protected: // local decomposition. virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override; @@ -57,7 +59,8 @@ namespace drawinglayer const Primitive2DContainer& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool b3DShape); + bool b3DShape, + const basegfx::B2DHomMatrix& rObjectMatrix); // data access const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; } diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 61dd7d27e21b..bf1249be1c47 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -149,13 +149,13 @@ namespace sdr::contact basegfx::B2DHomMatrix aTextBoxMatrix; bool bWordWrap(false); + // take unrotated snap rect as default, then get the + // unrotated text box. Rotation needs to be done centered + const tools::Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); + const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aObjectBound); + if(bHasText) { - // take unrotated snap rect as default, then get the - // unrotated text box. Rotation needs to be done centered - const tools::Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect()); - const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(aObjectBound); - // #i101684# get the text range unrotated and absolute to the object range const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect()); @@ -230,6 +230,12 @@ namespace sdr::contact bWordWrap = GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP).GetValue(); } + // fill object matrix + const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( + aObjectRange.getWidth(), aObjectRange.getHeight(), + /*fShearX=*/0, /*fRotate=*/0, + aObjectRange.getMinX(), aObjectRange.getMinY())); + // create primitive const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrCustomShapePrimitive2D( @@ -237,7 +243,8 @@ namespace sdr::contact xGroup, aTextBoxMatrix, bWordWrap, - b3DShape)); + b3DShape, + aObjectMatrix)); xRetval = drawinglayer::primitive2d::Primitive2DContainer { xReference }; } diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx index 378d78f5c6f6..eac5278ada2d 100644 --- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx @@ -74,7 +74,13 @@ namespace drawinglayer::primitive2d // shadow will be correct (using ColorModifierStack), but expensive. if(!get3DShape()) { - aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow()); + basegfx::B2DTuple aScale; + basegfx::B2DTuple aTranslate; + double fRotate = 0; + double fShearX = 0; + maTransform.decompose(aScale, aTranslate, fRotate, fShearX); + aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow(), + aTranslate.getX(), aTranslate.getY()); } } @@ -86,13 +92,15 @@ namespace drawinglayer::primitive2d const Primitive2DContainer& rSubPrimitives, const basegfx::B2DHomMatrix& rTextBox, bool bWordWrap, - bool b3DShape) + bool b3DShape, + const basegfx::B2DHomMatrix& rTransform) : BufferedDecompositionPrimitive2D(), maSdrSTAttribute(rSdrSTAttribute), maSubPrimitives(rSubPrimitives), maTextBox(rTextBox), mbWordWrap(bWordWrap), - mb3DShape(b3DShape) + mb3DShape(b3DShape), + maTransform(rTransform) { } |