summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d
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 /drawinglayer/source/processor2d
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 'drawinglayer/source/processor2d')
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx6
2 files changed, 5 insertions, 5 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 7ea03c9afd0c..87ae848b3ca9 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -272,7 +272,7 @@ void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient(
}
o_rVCLGradient.SetAngle(
- Degree10(static_cast<sal_uInt16>(rFiGrAtt.getAngle() * (1.0 / F_PI1800))));
+ Degree10(static_cast<sal_uInt32>(basegfx::rad2deg<100>(rFiGrAtt.getAngle()))));
o_rVCLGradient.SetBorder(static_cast<sal_uInt16>(rFiGrAtt.getBorder() * 100.0));
o_rVCLGradient.SetOfsX(static_cast<sal_uInt16>(rFiGrAtt.getOffsetX() * 100.0));
o_rVCLGradient.SetOfsY(static_cast<sal_uInt16>(rFiGrAtt.getOffsetY() * 100.0));
@@ -1904,7 +1904,7 @@ void VclMetafileProcessor2D::processPolyPolygonHatchPrimitive2D(
Hatch(aHatchStyle,
Color(maBColorModifierStack.getModifiedColor(rFillHatchAttribute.getColor())),
basegfx::fround(rFillHatchAttribute.getDistance()),
- Degree10(basegfx::fround(rFillHatchAttribute.getAngle() / F_PI1800))));
+ Degree10(basegfx::fround(basegfx::rad2deg<10>(rFillHatchAttribute.getAngle())))));
impEndSvtGraphicFill(pSvtGraphicFill.get());
}
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 967b70aa793e..139bb0ba080a 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -852,8 +852,8 @@ void VclPixelProcessor2D::processFillHatchPrimitive2D(
const basegfx::B2DVector aDiscreteDistance(
maCurrentTransformation * basegfx::B2DVector(rFillHatchAttributes.getDistance(), 0.0));
const sal_uInt32 nDistance(basegfx::fround(aDiscreteDistance.getLength()));
- const sal_uInt16 nAngle10(
- static_cast<sal_uInt16>(basegfx::fround(rFillHatchAttributes.getAngle() / F_PI1800)));
+ const sal_uInt32 nAngle10(
+ basegfx::rad2deg<10>(basegfx::fround(rFillHatchAttributes.getAngle())));
::Hatch aVCLHatch(eHatchStyle, Color(rFillHatchAttributes.getColor()), nDistance,
Degree10(nAngle10));
@@ -1216,7 +1216,7 @@ void VclPixelProcessor2D::processFillGradientPrimitive2D(
Gradient aGradient(eGradientStyle, Color(rFillGradient.getStartColor()),
Color(rFillGradient.getEndColor()));
- aGradient.SetAngle(Degree10(static_cast<int>(rFillGradient.getAngle() / F_PI1800)));
+ aGradient.SetAngle(Degree10(static_cast<int>(basegfx::rad2deg<10>(rFillGradient.getAngle()))));
aGradient.SetBorder(rFillGradient.getBorder() * 100);
aGradient.SetOfsX(rFillGradient.getOffsetX() * 100.0);
aGradient.SetOfsY(rFillGradient.getOffsetY() * 100.0);