diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-20 07:27:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-21 08:13:05 +0200 |
commit | 0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 (patch) | |
tree | 908983b02f466e0a49599edc70aaa1baaa240371 /vcl/workben | |
parent | b84afd2188d6993c91081885dc24664bd3f1cc73 (diff) |
new tools::Degree10 strong typedef
partly to flush some use of "long" out the codebase,
but also to make it obvious which units are being used
for angle values.
Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/svptest.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 77c7ac3cb28b..1e67f17b1942 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -234,7 +234,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR FontMetric aFont = rRenderContext.GetDevFont((i * nFontCount) / nFontSamples); aFont.SetFontHeight(400 + (i % 7) * 100); - aFont.SetOrientation(i * (3600 / nFontSamples)); + aFont.SetOrientation(Degree10(i * (3600 / nFontSamples))); rRenderContext.SetFont(aFont); sal_uInt8 nRed = (i << 6) & 0xC0; @@ -265,7 +265,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR Color const aDarkGreen(0, 0x40, 0); Gradient aGradient(GradientStyle::Linear, aBlack, aWhite); - aGradient.SetAngle(900); + aGradient.SetAngle(Degree10(900)); rRenderContext.DrawGradient(tools::Rectangle(Point(1000, 4500), Size(aPaperSize.Width() - 2000, 500)), aGradient); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index a089301db7cf..36711fc58084 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -475,7 +475,7 @@ public: aFontRect.AdjustTop(nHeight/2 ); aFontRect.AdjustBottom(nHeight ); - aFont.SetOrientation(45 * 10); // 45 degrees + aFont.SetOrientation(Degree10(450)); // 45 degrees rDev.SetFont(aFont); rDev.DrawText(aFontRect, aText); @@ -691,7 +691,7 @@ public: case 2: { tools::Polygon aPoly(aSub); - aPoly.Rotate(aSub.Center(), 450); + aPoly.Rotate(aSub.Center(), Degree10(450)); aPoly.Clip(aSmaller); aRegion = vcl::Region(aPoly); break; @@ -834,7 +834,7 @@ public: aGradient.SetStartColor(nStartCols[i]); aGradient.SetEndColor(nEndCols[i]); aGradient.SetStyle(eStyles[i]); - aGradient.SetAngle(nAngles[i]); + aGradient.SetAngle(Degree10(nAngles[i])); aGradient.SetBorder(nBorders[i]); rDev.DrawGradient(aSub, aGradient); } @@ -1047,7 +1047,7 @@ public: case 3: case 0: // 45degree rectangle. aPoly = tools::Polygon(aPieces[i]); - aPoly.Rotate(aPieces[i].Center(), 450); + aPoly.Rotate(aPieces[i].Center(), Degree10(450)); break; case 1: // arc aPoly = tools::Polygon(aPieces[i], @@ -1058,7 +1058,7 @@ public: aPoly = tools::Polygon(aPieces[i], aPieces[i].GetWidth()/5, aPieces[i].GetHeight()/5); - aPoly.Rotate(aPieces[i].Center(), 450); + aPoly.Rotate(aPieces[i].Center(), Degree10(450)); break; } aClipRegion = vcl::Region(aPoly); |