summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/quartz/ctfonts.cxx9
-rw-r--r--vcl/skia/gdiimpl.cxx2
-rw-r--r--vcl/source/bitmap/bitmappaint.cxx4
-rw-r--r--vcl/source/gdi/gdimtf.cxx2
-rw-r--r--vcl/source/gdi/gradient.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
-rw-r--r--vcl/source/outdev/hatch.cxx4
-rw-r--r--vcl/source/outdev/textline.cxx4
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx2
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx2
10 files changed, 15 insertions, 20 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index f7c922b8aa9e..99b9066d3a0a 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -41,11 +41,6 @@
#include <sallayout.hxx>
#include <hb-coretext.h>
-static double toRadian(int nDegree)
-{
- return nDegree * (M_PI / 1800.0);
-}
-
CoreTextStyle::CoreTextStyle(const vcl::font::PhysicalFontFace& rPFF, const vcl::font::FontSelectPattern& rFSP)
: LogicalFontInstance(rPFF, rFSP)
, mfFontStretch( 1.0 )
@@ -56,7 +51,7 @@ CoreTextStyle::CoreTextStyle(const vcl::font::PhysicalFontFace& rPFF, const vcl:
double fScaledFontHeight = rFSP.mfExactHeight;
// convert font rotation to radian
- mfFontRotation = toRadian(rFSP.mnOrientation.get());
+ mfFontRotation = toRadians(rFSP.mnOrientation);
// dummy matrix so we can use CGAffineTransformConcat() below
CGAffineTransform aMatrix = CGAffineTransformMakeTranslation(0, 0);
@@ -90,7 +85,7 @@ CoreTextStyle::CoreTextStyle(const vcl::font::PhysicalFontFace& rPFF, const vcl:
(rFSP.GetItalic() == ITALIC_OBLIQUE)) &&
(rPFF.GetItalic() == ITALIC_NONE))
{
- aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMake(1, 0, toRadian(120), 1, 0, 0));
+ aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMake(1, 0, basegfx::deg2rad(12), 1, 0, 0));
}
CTFontDescriptorRef pFontDesc = reinterpret_cast<CTFontDescriptorRef>(rPFF.GetFontId());
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 81f581d6ff78..ae07357cb0c1 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -2205,7 +2205,7 @@ bool SkiaSalGraphicsImpl::implDrawGradient(const basegfx::B2DPolyPolygon& rPolyP
return true;
}
-static double toRadian(Degree10 degree10th) { return (3600 - degree10th.get()) * M_PI / 1800.0; }
+static double toRadian(Degree10 degree10th) { return toRadians(3600_deg10 - degree10th); }
static double toCos(Degree10 degree10th) { return SkScalarCos(toRadian(degree10th)); }
static double toSin(Degree10 degree10th) { return SkScalarSin(toRadian(degree10th)); }
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) );
}
}
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 35e352555a10..b14c018652a4 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -95,7 +95,7 @@ namespace
double toRadian(Degree10 nDegree10th)
{
- return (3600_deg10 - nDegree10th).get() * M_PI / 1800.0;
+ return toRadians(3600_deg10 - nDegree10th);
}
cairo_t* syncCairoContext(cairo_t* cr)
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 5754e2e6448c..29fca5443a6c 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -418,7 +418,7 @@ FreetypeFont::FreetypeFont(FreetypeFontInstance& rFontInstance, const std::share
if( rFSD.mnOrientation )
{
- const double dRad = rFSD.mnOrientation.get() * ( 2 * M_PI / 3600.0 );
+ const double dRad = toRadians(rFSD.mnOrientation);
mnCos = static_cast<tools::Long>( 0x10000 * cos( dRad ) + 0.5 );
mnSin = static_cast<tools::Long>( 0x10000 * sin( dRad ) + 0.5 );
}