summaryrefslogtreecommitdiff
path: root/canvas/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-19 00:22:31 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-19 15:42:03 +0100
commitbc0ab08634f59e1a1814e575fe6ad5e50bf1aee1 (patch)
tree8691eec1adefd9e4def8245898e8a3e5c5542037 /canvas/source
parent168ae4c00a86b7534dedd303f9ef008e19822b99 (diff)
Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversions
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'canvas/source')
-rw-r--r--canvas/source/cairo/cairo_canvashelper_text.cxx2
-rw-r--r--canvas/source/vcl/canvashelper.cxx2
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/vcl/impltools.cxx2
4 files changed, 4 insertions, 4 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx
index c5f387e27c60..5f78bb71a225 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -99,7 +99,7 @@ namespace cairocanvas
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
- io_rVCLFont.SetOrientation( Degree10(static_cast< sal_Int16 >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) )) );
+ io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-basegfx::rad2deg<10>(fmod(nRotate, 2*M_PI))) ) );
// TODO(F2): Missing functionality in VCL: shearing
o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) );
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 1a2f7209562f..918a8f5f97fe 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -792,7 +792,7 @@ namespace vclcanvas
// degrees with the orientation reversed: [0,2Pi) ->
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
- const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
+ const double nAngleInTenthOfDegrees (3600.0 - basegfx::rad2deg<10>(nRotate));
aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj = std::make_shared<GraphicObject>( aBmpEx );
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 5cbf9ad3bc28..33f4f5c5318c 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -798,7 +798,7 @@ namespace vclcanvas
// degrees with the orientation reversed: [0,2Pi) ->
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
- const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
+ const double nAngleInTenthOfDegrees (3600.0 - basegfx::rad2deg<10>(nRotate));
aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj = std::make_shared<GraphicObject>( aBmpEx );
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index 53faa65ffa71..025b80bd2233 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -126,7 +126,7 @@ namespace vclcanvas::tools
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
- io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
+ io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-basegfx::rad2deg<10>(fmod(nRotate, 2*M_PI))) ) );
// TODO(F2): Missing functionality in VCL: shearing
o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) );