summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/gradtrns.cxx20
-rw-r--r--svx/source/svdraw/svdoashp.cxx9
-rw-r--r--svx/source/svdraw/svdotext.cxx6
3 files changed, 16 insertions, 19 deletions
diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx
index 660f94b0d61b..640636bf44c9 100644
--- a/svx/source/svdraw/gradtrns.cxx
+++ b/svx/source/svdraw/gradtrns.cxx
@@ -68,7 +68,7 @@ void GradTransformer::GradToVec(GradTransGradient const & rG, GradTransVector& r
if(rG.aGradient.GetAngle())
{
- const double fAngle = static_cast<double>(rG.aGradient.GetAngle()) * (F_PI180 / 10.0);
+ const double fAngle = basegfx::deg2rad(rG.aGradient.GetAngle() / 10.0);
const basegfx::B2DHomMatrix aTransformation(basegfx::utils::createRotateAroundPoint(aCenter, -fAngle));
aStartPos *= aTransformation;
@@ -91,7 +91,7 @@ void GradTransformer::GradToVec(GradTransGradient const & rG, GradTransVector& r
if(rG.aGradient.GetAngle())
{
- const double fAngle = static_cast<double>(rG.aGradient.GetAngle()) * (F_PI180 / 10.0);
+ const double fAngle = basegfx::deg2rad(rG.aGradient.GetAngle() / 10.0);
const basegfx::B2DHomMatrix aTransformation(basegfx::utils::createRotateAroundPoint(aCenter, -fAngle));
aStartPos *= aTransformation;
@@ -115,7 +115,7 @@ void GradTransformer::GradToVec(GradTransGradient const & rG, GradTransVector& r
if(rG.aGradient.GetAngle())
{
- const double fAngle = static_cast<double>(rG.aGradient.GetAngle()) * (F_PI180 / 10.0);
+ const double fAngle = basegfx::deg2rad(rG.aGradient.GetAngle() / 10.0);
const basegfx::B2DHomMatrix aTransformation(basegfx::utils::createRotateAroundPoint(aEndPos, -fAngle));
aStartPos *= aTransformation;
@@ -150,7 +150,7 @@ void GradTransformer::GradToVec(GradTransGradient const & rG, GradTransVector& r
if(rG.aGradient.GetAngle())
{
- const double fAngle = static_cast<double>(rG.aGradient.GetAngle()) * (F_PI180 / 10.0);
+ const double fAngle = basegfx::deg2rad(rG.aGradient.GetAngle() / 10.0);
const basegfx::B2DHomMatrix aTransformation(basegfx::utils::createRotateAroundPoint(aEndPos, -fAngle));
aStartPos *= aTransformation;
@@ -219,8 +219,7 @@ void GradTransformer::VecToGrad(GradTransVector const & rV, GradTransGradient& r
aFullVec.normalize();
- double fNewFullAngle(atan2(aFullVec.getY(), aFullVec.getX()));
- fNewFullAngle /= F_PI180;
+ double fNewFullAngle(basegfx::rad2deg(atan2(aFullVec.getY(), aFullVec.getX())));
fNewFullAngle *= -10.0;
fNewFullAngle += 900.0;
@@ -304,8 +303,7 @@ void GradTransformer::VecToGrad(GradTransVector const & rV, GradTransGradient& r
}
aFullVec.normalize();
- double fNewFullAngle(atan2(aFullVec.getY(), aFullVec.getX()));
- fNewFullAngle /= F_PI180;
+ double fNewFullAngle(basegfx::rad2deg(atan2(aFullVec.getY(), aFullVec.getX())));
fNewFullAngle *= -10.0;
fNewFullAngle += 900.0;
@@ -400,8 +398,7 @@ void GradTransformer::VecToGrad(GradTransVector const & rV, GradTransGradient& r
// angle is not definitely necessary for these modes, but it makes
// controlling more fun for the user
aFullVec.normalize();
- double fNewFullAngle(atan2(aFullVec.getY(), aFullVec.getX()));
- fNewFullAngle /= F_PI180;
+ double fNewFullAngle(basegfx::rad2deg(atan2(aFullVec.getY(), aFullVec.getX())));
fNewFullAngle *= -10.0;
fNewFullAngle += 900.0;
@@ -496,8 +493,7 @@ void GradTransformer::VecToGrad(GradTransVector const & rV, GradTransGradient& r
// angle is not definitely necessary for these modes, but it makes
// controlling more fun for the user
aFullVec.normalize();
- double fNewFullAngle(atan2(aFullVec.getY(), aFullVec.getX()));
- fNewFullAngle /= F_PI180;
+ double fNewFullAngle(basegfx::rad2deg(atan2(aFullVec.getY(), aFullVec.getX())));
fNewFullAngle *= -10.0;
fNewFullAngle += 900.0;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 8d839abb77d5..317dd6daa40d 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -1741,7 +1741,8 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
if ( nShearAngle )
ShearPoint( aGlue, aRef, fTan );
- RotatePoint( aGlue, aRef, sin( fObjectRotation * F_PI180 ), cos( fObjectRotation * F_PI180 ) );
+ RotatePoint(aGlue, aRef, sin(basegfx::deg2rad(fObjectRotation)),
+ cos(basegfx::deg2rad(fObjectRotation)));
if ( bMirroredX )
aGlue.setX( maRect.GetWidth() - aGlue.X() );
if ( bMirroredY )
@@ -2938,7 +2939,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
// #i123181# The fix for #121932# here was wrong, the trunk version does not correct the
// mirrored shear values, neither at the object level, nor on the API or XML level. Taking
// back the mirroring of the shear angle
- aGeoStat.nShearAngle = FRound((atan(fShearX) / F_PI180) * 100.0);
+ aGeoStat.nShearAngle = FRound(basegfx::rad2deg(atan(fShearX)) * 100.0);
aGeoStat.RecalcTan();
Shear(Point(), aGeoStat.nShearAngle, aGeoStat.nTan, false);
}
@@ -2967,8 +2968,8 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
{
// get turn and shear
- double fRotate = fObjectRotation * F_PI180;
- double fShearX = (aGeo.nShearAngle / 100.0) * F_PI180;
+ double fRotate = basegfx::deg2rad(fObjectRotation);
+ double fShearX = basegfx::deg2rad(aGeo.nShearAngle / 100.0);
// get aRect, this is the unrotated snaprect
tools::Rectangle aRectangle(maRect);
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 54fcda68de12..b0799a92b5d8 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1603,8 +1603,8 @@ void SdrTextObj::SetVerticalWriting(bool bVertical)
bool SdrTextObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& /*rPolyPolygon*/) const
{
// get turn and shear
- double fRotate = (aGeo.nRotationAngle / 100.0) * F_PI180;
- double fShearX = (aGeo.nShearAngle / 100.0) * F_PI180;
+ double fRotate = basegfx::deg2rad(aGeo.nRotationAngle / 100.0);
+ double fShearX = basegfx::deg2rad(aGeo.nShearAngle / 100.0);
// get aRect, this is the unrotated snaprect
tools::Rectangle aRectangle(maRect);
@@ -1690,7 +1690,7 @@ void SdrTextObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b
if(!basegfx::fTools::equalZero(fShearX))
{
GeoStat aGeoStat;
- aGeoStat.nShearAngle = FRound((atan(fShearX) / F_PI180) * 100.0);
+ aGeoStat.nShearAngle = FRound(basegfx::rad2deg(atan(fShearX)) * 100.0);
aGeoStat.RecalcTan();
Shear(Point(), aGeoStat.nShearAngle, aGeoStat.nTan, false);
}