diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 00:22:31 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-19 15:42:03 +0100 |
commit | bc0ab08634f59e1a1814e575fe6ad5e50bf1aee1 (patch) | |
tree | 8691eec1adefd9e4def8245898e8a3e5c5542037 /vcl/source | |
parent | 168ae4c00a86b7534dedd303f9ef008e19822b99 (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 'vcl/source')
-rw-r--r-- | vcl/source/bitmap/bitmappaint.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gradient.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/hatch.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/textline.cxx | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index e06f96e8abd7..034fd5738a2a 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -363,8 +363,8 @@ bool Bitmap::Rotate(Degree10 nAngle10, const Color& rFillColor) if (pWriteAcc) { const BitmapColor aFillColor(pWriteAcc->GetBestMatchingColor(rFillColor)); - const double fCosAngle = cos(nAngle10.get() * F_PI1800); - const double fSinAngle = sin(nAngle10.get() * F_PI1800); + const double fCosAngle = cos(toRadians(nAngle10)); + const double fSinAngle = sin(toRadians(nAngle10)); const double fXMin = aNewBound.Left(); const double fYMin = aNewBound.Top(); const tools::Long nWidth = aSizePix.Width(); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 86e020b92dac..3607a81ec2e8 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -825,7 +825,7 @@ void GDIMetaFile::Rotate( Degree10 nAngle10 ) GDIMetaFile aMtf; ScopedVclPtrInstance< VirtualDevice > aMapVDev; - const double fAngle = F_PI1800 * nAngle10.get(); + const double fAngle = toRadians(nAngle10); const double fSin = sin( fAngle ); const double fCos = cos( fAngle ); tools::Rectangle aRect( Point(), GetPrefSize() ); diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx index 899861cfc222..b94223a427c4 100644 --- a/vcl/source/gdi/gradient.cxx +++ b/vcl/source/gdi/gradient.cxx @@ -201,7 +201,7 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB if( GetStyle() == GradientStyle::Linear || GetStyle() == GradientStyle::Axial ) { - const double fAngle = nAngle.get() * F_PI1800; + const double fAngle = toRadians(nAngle); const double fWidth = aRect.GetWidth(); const double fHeight = aRect.GetHeight(); double fDX = fWidth * fabs( cos( fAngle ) ) + @@ -222,7 +222,7 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB { if( GetStyle() == GradientStyle::Square || GetStyle() == GradientStyle::Rect ) { - const double fAngle = nAngle.get() * F_PI1800; + const double fAngle = toRadians(nAngle); const double fWidth = aRect.GetWidth(); const double fHeight = aRect.GetHeight(); double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) ); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6aa8cb0eec73..48dda1916a0f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -7138,7 +7138,7 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, tools::Long nWidth, FontStr aLine.append( "q " ); // rotate and translate matrix - double fAngle = static_cast<double>(m_aCurrentPDFState.m_aFont.GetOrientation().get()) * M_PI / 1800.0; + double fAngle = toRadians(m_aCurrentPDFState.m_aFont.GetOrientation()); Matrix3 aMat; aMat.rotate( fAngle ); aMat.translate( aPos.X(), aPos.Y() ); diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 89e89f8a1db4..160aa904ffd6 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -236,7 +236,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n } else if( nAngle >= Degree10(-450) && nAngle <= 450_deg10 ) { - const double fAngle = F_PI1800 * std::abs( nAngle.get() ); + const double fAngle = std::abs( toRadians(nAngle) ); const double fTan = tan( fAngle ); const tools::Long nYOff = FRound( ( rRect.Right() - rRect.Left() ) * fTan ); tools::Long nPY; @@ -269,7 +269,7 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, tools::Long n } else { - const double fAngle = F_PI1800 * std::abs( nAngle.get() ); + const double fAngle = std::abs( toRadians(nAngle) ); const double fTan = tan( fAngle ); const tools::Long nXOff = FRound( ( rRect.Bottom() - rRect.Top() ) / fTan ); tools::Long nPX; diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 5fe1538f37f4..c4fcb33bf5d0 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -759,7 +759,7 @@ void OutputDevice::ImplDrawTextLine( tools::Long nX, tools::Long nY, { tools::Long nXAdd = nWidth - nDistX; if( mpFontInstance->mnOrientation ) - nXAdd = FRound( nXAdd * cos( mpFontInstance->mnOrientation.get() * F_PI1800 ) ); + nXAdd = FRound( nXAdd * cos( toRadians(mpFontInstance->mnOrientation) ) ); nX += nXAdd - 1; } @@ -831,7 +831,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, FontStrikeout eStri if( mpFontInstance->mnOrientation ) { const tools::Long nDY = aPos.Y() - aStartPt.Y(); - const double fRad = mpFontInstance->mnOrientation.get() * F_PI1800; + const double fRad = toRadians(mpFontInstance->mnOrientation); nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) ); } } |