svx/source/sdr/contact/viewcontactofgraphic.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrcircobj.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 4 ++-- svx/source/sdr/contact/viewcontactofsdrole2obj.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrrectobj.cxx | 2 +- svx/source/svdraw/svdoashp.cxx | 4 ++-- svx/source/svdraw/svdocirc.cxx | 2 +- svx/source/svdraw/svdopath.cxx | 2 +- svx/source/table/viewcontactoftableobj.cxx | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-)
New commits: commit 1aeae0642055b1667208c16b206781fd10770664 Author: Noel <noel.gran...@collabora.co.uk> AuthorDate: Tue Dec 22 11:14:19 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Dec 22 11:24:30 2020 +0100 use precalculated members of GeoState.. .. in a couple of places that seem to have been missed. Change-Id: I5e40b46614fe07cd8b47f7148e3e5ec130dd05b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108146 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 8fceef864ae2..80140953d91b 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -340,7 +340,7 @@ namespace sdr::contact } // fill object matrix - const double fShearX(rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0); + const double fShearX(-rGeoStat.mfTanShearAngle); const double fRotate(nRotationAngle ? (36000 - nRotationAngle) * F_PI18000 : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx index 4b0f06a77ab7..3e14a74d7516 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx @@ -73,7 +73,7 @@ namespace sdr::contact // fill object matrix basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), - rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0, + -rGeoStat.mfTanShearAngle, rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index 6379c960961f..beafebfb7dd3 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -56,7 +56,7 @@ namespace sdr::contact const basegfx::B2DHomMatrix aObjectMatrix( basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), - rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0, + -rGeoStat.mfTanShearAngle, rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 2b1a1913f003..1ad9b8a0e44d 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -68,7 +68,7 @@ namespace sdr::contact if(rGeoStat.nShearAngle) { - aRotMatrix.shearX(tan((36000 - rGeoStat.nShearAngle) * F_PI18000)); + aRotMatrix.shearX(-rGeoStat.mfTanShearAngle); } if(rGeoStat.nRotationAngle) @@ -197,7 +197,7 @@ namespace sdr::contact if(rGeoStat.nShearAngle) { - aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearAngle) * F_PI18000)); + aTextBoxMatrix.shearX(-rGeoStat.mfTanShearAngle); } if(rGeoStat.nRotationAngle) diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index 57077e7b30eb..ab7a93f421cb 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -62,7 +62,7 @@ basegfx::B2DHomMatrix ViewContactOfSdrOle2Obj::createObjectTransform() const // create object matrix const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat()); - const double fShearX(rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0); + const double fShearX(-rGeoStat.mfTanShearAngle); const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0); return basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 83fe88b6a637..bae0147ae241 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -157,7 +157,7 @@ namespace sdr::contact aObjectMatrix = basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( fScaleX, fScaleY, - rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0, + -rGeoStat.mfTanShearAngle, rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY()); diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx index 5dfc826fb05f..370c1e8a1a07 100644 --- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx @@ -56,7 +56,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrRectObj::createV // fill object matrix basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), - rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0, + -rGeoStat.mfTanShearAngle, rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0, aObjectRange.getMinX(), aObjectRange.getMinY())); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index f575b2622447..c935ca6f9093 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1564,8 +1564,8 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, tools::Long nAngle, double // the rotation angle for ashapes is stored in fObjectRotation, this rotation // has to be applied to the text object (which is internally using aGeo.nAngle). SdrTextObj::NbcRotate( maRect.TopLeft(), -aGeo.nRotationAngle, // retrieving the unrotated text object - sin( (-aGeo.nRotationAngle) * F_PI18000 ), - cos( (-aGeo.nRotationAngle) * F_PI18000 ) ); + -aGeo.mfSinRotationAngle, + aGeo.mfCosRotationAngle ); aGeo.nRotationAngle = 0; // resetting aGeo data aGeo.RecalcSinCos(); diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 951f626b9f77..c55d935a2965 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -292,7 +292,7 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, // shear, rotate and back to top left (if needed) aMatrix = basegfx::utils::createShearXRotateTranslateB2DHomMatrix( - aGeo.nShearAngle ? tan((36000 - aGeo.nShearAngle) * F_PI18000) : 0.0, + -aGeo.mfTanShearAngle, aGeo.nRotationAngle ? (36000 - aGeo.nRotationAngle) * F_PI18000 : 0.0, aTopLeft) * aMatrix; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 1c3cae84e816..a57cf2ab1f6f 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2817,7 +2817,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP // build mathematically correct (negative shear and rotate) object transform // containing shear and rotate to extract unsheared, unrotated polygon basegfx::B2DHomMatrix aObjectMatrix; - aObjectMatrix.shearX(tan((36000 - aGeo.nShearAngle) * F_PI18000)); + aObjectMatrix.shearX(-aGeo.mfTanShearAngle); aObjectMatrix.rotate((36000 - aGeo.nRotationAngle) * F_PI18000); // create inverse from it and back-transform polygon diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index bd950a02f7fb..9ea6ba050a20 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -357,7 +357,7 @@ namespace sdr::contact // create object matrix const GeoStat& rGeoStat(rTableObj.GetGeoStat()); - const double fShearX(rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0); + const double fShearX(-rGeoStat.mfTanShearAngle); const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, @@ -421,7 +421,7 @@ namespace sdr::contact // create object matrix const GeoStat& rGeoStat(rTableObj.GetGeoStat()); - const double fShearX(rGeoStat.nShearAngle ? tan((36000 - rGeoStat.nShearAngle) * F_PI18000) : 0.0); + const double fShearX(-rGeoStat.mfTanShearAngle); const double fRotate(rGeoStat.nRotationAngle ? (36000 - rGeoStat.nRotationAngle) * F_PI18000 : 0.0); const basegfx::B2DHomMatrix aObjectMatrix(basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix( aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits