summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-12-23 09:09:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-23 17:06:56 +0100
commit666e14ba6e82dcad6912a205694978b2736e4319 (patch)
treeb4f13570b51f96ee9f1e7825c4422ea55c8fa620 /svx
parent961f6db0b647614e8221185c0e8ac661d87de9b6 (diff)
add utility NbcRotate method
Change-Id: I66d016a22158f9f9ef68a80842e95e45516f0b4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108228 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx11
-rw-r--r--svx/source/svdraw/svdobj.cxx11
2 files changed, 13 insertions, 9 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index bca7c5bea8b2..11f26ff775b2 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -327,11 +327,7 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
xRenderedShape->Shear(rSdrObjCustomShape.GetSnapRect().Center(), nShearAngle, nTan, false);
}
if(nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
-
- xRenderedShape->NbcRotate(rSdrObjCustomShape.GetSnapRect().Center(), nRotateAngle, sin( a ), cos( a ));
- }
+ xRenderedShape->NbcRotate(rSdrObjCustomShape.GetSnapRect().Center(), nRotateAngle);
if ( bFlipV )
{
Point aLeft( aRect.Left(), ( aRect.Top() + aRect.Bottom() ) >> 1 );
@@ -428,10 +424,7 @@ drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeom
}
sal_Int32 nRotateAngle = aCustomShape2d.GetRotateAngle();
if( nRotateAngle )
- {
- double a = nRotateAngle * F_PI18000;
- pObj->NbcRotate( aRect.Center(), nRotateAngle, sin( a ), cos( a ) );
- }
+ pObj->NbcRotate( aRect.Center(), nRotateAngle );
if ( bFlipH )
{
Point aTop( ( aRect.Left() + aRect.Right() ) >> 1, aRect.Top() );
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 260d0b0dd2ac..44fa531177cb 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1401,6 +1401,17 @@ void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti
SetRectsDirty();
}
+void SdrObject::NbcRotate(const Point& rRef, tools::Long nAngle)
+{
+ if (nAngle == 0)
+ NbcRotate( rRef, nAngle, 0.0, 1.0 );
+ else
+ {
+ double a = nAngle * F_PI18000;
+ NbcRotate( rRef, nAngle, sin( a ), cos( a ) );
+ }
+}
+
void SdrObject::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
{
SetGlueReallyAbsolute(true);