From 1cc6fca4927b9684b1f5acedee7b60c0c7518e25 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 18 Nov 2021 23:42:32 +0300 Subject: Drop F_2PI Change-Id: Ie98606607b2ce262e4eed76bb8cd86fbfe846f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125506 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/bitmap/BitmapEx.cxx | 4 ++-- vcl/source/filter/ipict/shape.cxx | 14 +++++++------- vcl/source/outdev/bitmapex.cxx | 4 ++-- vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 2 +- vcl/workben/vcldemo.cxx | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'vcl') diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index d2c52c47a746..5a0502babba2 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -727,10 +727,10 @@ namespace return true; } - fRotate = fmod( fRotate, F_2PI ); + fRotate = fmod( fRotate, 2 * M_PI ); if (fRotate < 0) { - fRotate += F_2PI; + fRotate += 2 * M_PI; } if (!rtl::math::approxEqual(fRotate, 0) && !rtl::math::approxEqual(fRotate, M_PI_2) diff --git a/vcl/source/filter/ipict/shape.cxx b/vcl/source/filter/ipict/shape.cxx index 79643123639c..88a62cfd2ff2 100644 --- a/vcl/source/filter/ipict/shape.cxx +++ b/vcl/source/filter/ipict/shape.cxx @@ -171,17 +171,17 @@ namespace PictReaderShape { tools::Long const Y[2] = { arc.Top(), arc.Bottom() }; B2DPoint center(0.5*(X[1]+X[0]), 0.5*(Y[1]+Y[0])); - // We must have angl1 between 0 and F_2PI - while (angl1 < 0.0) { angl1 += F_2PI; angl2 += F_2PI; } - while (angl1 >= F_2PI) { angl1 -= F_2PI; angl2 -= F_2PI; } + // We must have angl1 between 0 and 2PI + while (angl1 < 0.0) { angl1 += 2 * M_PI; angl2 += 2 * M_PI; } + while (angl1 >= 2 * M_PI) { angl1 -= 2 * M_PI; angl2 -= 2 * M_PI; } // if this happen, we want a complete circle // so we set angl2 slightly less than angl1 - if (angl2 >= angl1+F_2PI) angl2 = angl1-0.001; + if (angl2 >= angl1 + 2 * M_PI) angl2 = angl1-0.001; - // We must have angl2 between 0 and F_2PI - while (angl2 < 0.0) angl2 += F_2PI; - while (angl2 >= F_2PI) angl2 -= F_2PI; + // We must have angl2 between 0 and 2PI + while (angl2 < 0.0) angl2 += 2 * M_PI; + while (angl2 >= 2 * M_PI) angl2 -= 2 * M_PI; B2DPolygon poly = basegfx::utils::createPolygonFromEllipseSegment(center, 0.5*(X[1]-X[0]), 0.5*(Y[1]-Y[0]), angl1, angl2); if (drawFrame) diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index cfa0512e9e4b..44170e633bfe 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -660,10 +660,10 @@ void OutputDevice::DrawTransformedBitmapEx( else { // Just rotation, can do that directly. - fFullRotate = fmod(fFullRotate * -1, F_2PI); + fFullRotate = fmod(fFullRotate * -1, 2 * M_PI); if (fFullRotate < 0) { - fFullRotate += F_2PI; + fFullRotate += 2 * M_PI; } Degree10 nAngle10(basegfx::fround(basegfx::rad2deg(fFullRotate) * 10)); aTransformed.Rotate(nAngle10, COL_TRANSPARENT); diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 74e3d6f55c37..7a31f981a371 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -420,7 +420,7 @@ FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, const std::share if( rFSD.mnOrientation ) { - const double dRad = rFSD.mnOrientation.get() * ( F_2PI / 3600.0 ); + const double dRad = rFSD.mnOrientation.get() * ( 2 * M_PI / 3600.0 ); mnCos = static_cast( 0x10000 * cos( dRad ) + 0.5 ); mnSin = static_cast( 0x10000 * sin( dRad ) + 0.5 ); } diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 372a96d3126f..a89857c099a7 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1260,7 +1260,7 @@ public: break; default: aTransform.translate(-aSize.Width()/2, -aSize.Height()/2); - aTransform.rotate(2 * F_2PI * i / nToRender); + aTransform.rotate(2 * 2 * M_PI * i / nToRender); aTransform.translate(aSize.Width()/2, aSize.Height()/2); break; } -- cgit