diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-31 11:36:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-31 21:47:59 +0200 |
commit | 0a440949c6653f7f1f81cb8aff4dabd326ed96a8 (patch) | |
tree | 019b6fa34d570241383fee28838ff350c7357dd6 /basegfx | |
parent | 2b401b7c0322d9ff972d252208ebe9a77913778d (diff) |
loplugin:constantparam
Change-Id: Iac66822757814d67383f6e19f3ab25e3dc7f8b0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155085
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dlinegeometry.cxx | 83 |
1 files changed, 18 insertions, 65 deletions
diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 37c7cfc172d2..437ebcbb496e 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -693,8 +693,7 @@ namespace basegfx const B2DPoint& rPoint, double fHalfLineWidth, B2DLineJoin eJoin, - double fMiterMinimumAngle, - basegfx::triangulator::B2DTriangleVector* pTriangles) + double fMiterMinimumAngle) { SAL_WARN_IF(fHalfLineWidth <= 0.0,"basegfx","createAreaGeometryForJoin: LineWidth too small (!)"); assert((eJoin != B2DLineJoin::NONE) && "createAreaGeometryForJoin: B2DLineJoin::NONE not allowed (!)"); @@ -721,19 +720,9 @@ namespace basegfx { case B2DLineJoin::Miter : { - if(nullptr != pTriangles) - { - pTriangles->emplace_back( - aEndPoint, - rPoint, - aStartPoint); - } - else - { - aEdgePolygon.append(aEndPoint); - aEdgePolygon.append(rPoint); - aEdgePolygon.append(aStartPoint); - } + aEdgePolygon.append(aEndPoint); + aEdgePolygon.append(rPoint); + aEdgePolygon.append(aStartPoint); // Look for the cut point between start point along rTangentPrev and // end point along rTangentEdge. -rTangentEdge should be used, but since @@ -746,18 +735,7 @@ namespace basegfx if(fCutPos != 0.0) { const B2DPoint aCutPoint(aStartPoint + (rTangentPrev * fCutPos)); - - if(nullptr != pTriangles) - { - pTriangles->emplace_back( - aStartPoint, - aCutPoint, - aEndPoint); - } - else - { - aEdgePolygon.append(aCutPoint); - } + aEdgePolygon.append(aCutPoint); } break; @@ -783,27 +761,14 @@ namespace basegfx if(aBow.count() > 1) { - if(nullptr != pTriangles) - { - for(sal_uInt32 a(0); a < aBow.count() - 1; a++) - { - pTriangles->emplace_back( - 0 == a ? aStartPoint : aBow.getB2DPoint(a), - rPoint, - aBow.count() - 1 == a + 1 ? aEndPoint : aBow.getB2DPoint(a + 1)); - } - } - else - { - // #i101491# - // use the original start/end positions; the ones from bow creation may be numerically - // different due to their different creation. To guarantee good merging quality with edges - // and edge roundings (and to reduce point count) - aEdgePolygon = aBow; - aEdgePolygon.setB2DPoint(0, aStartPoint); - aEdgePolygon.setB2DPoint(aEdgePolygon.count() - 1, aEndPoint); - aEdgePolygon.append(rPoint); - } + // #i101491# + // use the original start/end positions; the ones from bow creation may be numerically + // different due to their different creation. To guarantee good merging quality with edges + // and edge roundings (and to reduce point count) + aEdgePolygon = aBow; + aEdgePolygon.setB2DPoint(0, aStartPoint); + aEdgePolygon.setB2DPoint(aEdgePolygon.count() - 1, aEndPoint); + aEdgePolygon.append(rPoint); break; } @@ -814,19 +779,9 @@ namespace basegfx } default: // B2DLineJoin::Bevel { - if(nullptr != pTriangles) - { - pTriangles->emplace_back( - aEndPoint, - rPoint, - aStartPoint); - } - else - { - aEdgePolygon.append(aEndPoint); - aEdgePolygon.append(rPoint); - aEdgePolygon.append(aStartPoint); - } + aEdgePolygon.append(aEndPoint); + aEdgePolygon.append(rPoint); + aEdgePolygon.append(aStartPoint); break; } @@ -957,8 +912,7 @@ namespace basegfx aEdge.getStartPoint(), fHalfLineWidth, eJoin, - fMiterMinimumAngle, - nullptr)); + fMiterMinimumAngle)); } else if(aOrientation == B2VectorOrientation::Negative) { @@ -974,8 +928,7 @@ namespace basegfx aEdge.getStartPoint(), fHalfLineWidth, eJoin, - fMiterMinimumAngle, - nullptr)); + fMiterMinimumAngle)); } } |