diff options
Diffstat (limited to 'dviware/dvisvgm/src/TriangularPatch.cpp')
-rw-r--r-- | dviware/dvisvgm/src/TriangularPatch.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dviware/dvisvgm/src/TriangularPatch.cpp b/dviware/dvisvgm/src/TriangularPatch.cpp index 929fe1b885..01efe2e8f0 100644 --- a/dviware/dvisvgm/src/TriangularPatch.cpp +++ b/dviware/dvisvgm/src/TriangularPatch.cpp @@ -161,8 +161,7 @@ static inline double snap (double x) { * @param[in] callback object notified */ void TriangularPatch::approximate (int gridsize, bool overlap, double delta, Callback &callback) const { if (_colors[0] == _colors[1] && _colors[1] == _colors[2]) { - GraphicsPath<double> path; - getBoundaryPath(path); + GraphicsPath<double> path = getBoundaryPath(); callback.patchSegment(path, _colors[0]); } else { @@ -197,18 +196,21 @@ void TriangularPatch::approximate (int gridsize, bool overlap, double delta, Cal } -void TriangularPatch::getBoundaryPath(GraphicsPath<double> &path) const { +GraphicsPath<double> TriangularPatch::getBoundaryPath () const { + GraphicsPath<double> path; path.clear(); path.moveto(_points[0]); path.lineto(_points[1]); path.lineto(_points[2]); path.closepath(); + return path; } -void TriangularPatch::getBBox (BoundingBox &bbox) const { - bbox.invalidate(); +BoundingBox TriangularPatch::getBBox () const { + BoundingBox bbox; bbox.embed(_points[0]); bbox.embed(_points[1]); bbox.embed(_points[2]); + return bbox; } |