From bc0ab08634f59e1a1814e575fe6ad5e50bf1aee1 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 19 Nov 2021 00:22:31 +0300 Subject: 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 Tested-by: Jenkins --- drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 4 ++-- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drawinglayer/source/processor2d') 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(rFiGrAtt.getAngle() * (1.0 / F_PI1800)))); + Degree10(static_cast(basegfx::rad2deg<100>(rFiGrAtt.getAngle())))); o_rVCLGradient.SetBorder(static_cast(rFiGrAtt.getBorder() * 100.0)); o_rVCLGradient.SetOfsX(static_cast(rFiGrAtt.getOffsetX() * 100.0)); o_rVCLGradient.SetOfsY(static_cast(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(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(rFillGradient.getAngle() / F_PI1800))); + aGradient.SetAngle(Degree10(static_cast(basegfx::rad2deg<10>(rFillGradient.getAngle())))); aGradient.SetBorder(rFillGradient.getBorder() * 100); aGradient.SetOfsX(rFillGradient.getOffsetX() * 100.0); aGradient.SetOfsY(rFillGradient.getOffsetY() * 100.0); -- cgit