diff options
author | Norbert Preining <norbert@preining.info> | 2023-01-12 03:01:29 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-01-12 03:01:29 +0000 |
commit | 6a7900c93acc16d1bbd2f1e26286c7dd7387e6c0 (patch) | |
tree | 76196287351cba68a51934c49468bf1a7846aa76 /dviware/dvisvgm/src/PathClipper.cpp | |
parent | c1c19023b4b1d43cb874f84df5102b485853e672 (diff) |
CTAN sync 202301120301
Diffstat (limited to 'dviware/dvisvgm/src/PathClipper.cpp')
-rw-r--r-- | dviware/dvisvgm/src/PathClipper.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dviware/dvisvgm/src/PathClipper.cpp b/dviware/dvisvgm/src/PathClipper.cpp index b6a26c418e..50030f9657 100644 --- a/dviware/dvisvgm/src/PathClipper.cpp +++ b/dviware/dvisvgm/src/PathClipper.cpp @@ -2,7 +2,7 @@ ** PathClipper.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2022 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2023 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -51,7 +51,7 @@ inline DPair to_DPair (const IntPoint &p) { * is called. */ class FlattenActions : public CurvedPath::IterationActions { public: - FlattenActions (vector<Bezier> &curves, Polygons &polygons, int &numLines) + FlattenActions (vector<CubicBezier> &curves, Polygons &polygons, int &numLines) : _polygons(polygons), _curves(curves), _numLines(numLines) {} void moveto (const CurvedPath::Point &p) override { @@ -74,12 +74,12 @@ class FlattenActions : public CurvedPath::IterationActions { } void quadto (const CurvedPath::Point &p1, const CurvedPath::Point &p2) override { - Bezier bezier(_currentPoint, p1, p2); - addCurvePoints(bezier); + QuadBezier qbezier(_currentPoint, p1, p2); + addCurvePoints(CubicBezier(qbezier)); } void cubicto (const CurvedPath::Point &p1, const CurvedPath::Point &p2, const CurvedPath::Point &p3) override { - Bezier bezier(_currentPoint, p1, p2, p3); + CubicBezier bezier(_currentPoint, p1, p2, p3); addCurvePoints(bezier); } @@ -98,7 +98,7 @@ class FlattenActions : public CurvedPath::IterationActions { } protected: - void addCurvePoints (const Bezier &bezier) { + void addCurvePoints (const CubicBezier &bezier) { if (_currentPoly.empty()) // this shouldn't happen but in case it does, ... _currentPoly.emplace_back(IntPoint(0, 0, 0)); // ...add a start point first vector<DPair> points; // points of flattened curve @@ -122,7 +122,7 @@ class FlattenActions : public CurvedPath::IterationActions { CurvedPath::Point _startPoint, _currentPoint; Polygon _currentPoly; ///< polygon being created Polygons &_polygons; ///< all polygons created - vector<Bezier> &_curves; + vector<CubicBezier> &_curves; int &_numLines; }; @@ -288,7 +288,7 @@ void PathClipper::reconstruct (const Polygon &polygon, CurvedPath &path) { if (diff == 1 || label1.id <= 0) // line segment? path.lineto(to_DPair(polygon[index2])); else { // Bézier curve segment - Bezier bezier(_curves[label1.id-1], label1.t, label2.t); + CubicBezier bezier(_curves[label1.id-1], label1.t, label2.t); if (label1.t > label2.t) bezier.reverse(); path.cubicto(bezier.point(1), bezier.point(2), bezier.point(3)); |