diff options
author | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 07:37:22 +0000 |
---|---|---|
committer | Pascal Junck <pjunck@openoffice.org> | 2004-11-03 07:37:22 +0000 |
commit | 58b002db3346dcb37e5b9f9ee18ad3e4fd1c341c (patch) | |
tree | 2e106a43d79eb479395c7b5f96378a7ab5385157 /basegfx/source/curve | |
parent | 866d3eec153051ba3ab9eeafff38d84a9ac66319 (diff) |
INTEGRATION: CWS aw019 (1.7.26); FILE MERGED
2004/10/06 11:14:27 aw 1.7.26.1: #i34831#
Diffstat (limited to 'basegfx/source/curve')
-rw-r--r-- | basegfx/source/curve/b2dbeziertools.cxx | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/basegfx/source/curve/b2dbeziertools.cxx b/basegfx/source/curve/b2dbeziertools.cxx index 906ae45a0d27..a3e107772d55 100644 --- a/basegfx/source/curve/b2dbeziertools.cxx +++ b/basegfx/source/curve/b2dbeziertools.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b2dbeziertools.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: rt $ $Date: 2004-05-19 13:17:32 $ + * last change: $Author: pjunck $ $Date: 2004-11-03 08:37:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -528,51 +528,62 @@ namespace basegfx sal_Int32 adaptiveSubdivideByDistance( B2DPolygon& rPoly, const B2DCubicBezier& rCurve, - double distanceBounds ) + double distanceBounds, + bool bAddEndPoint ) { const B2DPoint start( rCurve.getStartPoint() ); const B2DPoint control1( rCurve.getControlPointA() ); const B2DPoint control2( rCurve.getControlPointB() ); const B2DPoint end( rCurve.getEndPoint() ); - const sal_Int32 nPoints( ImplAdaptiveSubdivide( rPoly, - DistanceErrorFunctor( distanceBounds ), - start.getX(), start.getY(), - control1.getX(), control1.getY(), - control2.getX(), control2.getY(), - end.getX(), end.getY(), - 0 ) ); + sal_Int32 nPoints( ImplAdaptiveSubdivide( rPoly, + DistanceErrorFunctor( distanceBounds ), + start.getX(), start.getY(), + control1.getX(), control1.getY(), + control2.getX(), control2.getY(), + end.getX(), end.getY(), + 0 ) ); // finish polygon - rPoly.append( end ); + if ( bAddEndPoint ) + { + rPoly.append( end ); + nPoints++; + } return nPoints; } sal_Int32 adaptiveSubdivideByAngle( B2DPolygon& rPoly, const B2DCubicBezier& rCurve, - double angleBounds ) + double angleBounds, + bool bAddEndPoint ) { const B2DPoint start( rCurve.getStartPoint() ); const B2DPoint control1( rCurve.getControlPointA() ); const B2DPoint control2( rCurve.getControlPointB() ); const B2DPoint end( rCurve.getEndPoint() ); - const sal_Int32 nPoints( ImplAdaptiveSubdivide( rPoly, - AngleErrorFunctor( angleBounds ), - start.getX(), start.getY(), - control1.getX(), control1.getY(), - control2.getX(), control2.getY(), - end.getX(), end.getY(), - 0 ) ); + sal_Int32 nPoints( ImplAdaptiveSubdivide( rPoly, + AngleErrorFunctor( angleBounds ), + start.getX(), start.getY(), + control1.getX(), control1.getY(), + control2.getX(), control2.getY(), + end.getX(), end.getY(), + 0 ) ); // finish polygon - rPoly.append( end ); + if ( bAddEndPoint ) + { + rPoly.append( end ); + nPoints++; + } return nPoints; } sal_Int32 adaptiveSubdivideByDistance( B2DPolygon& rPoly, const B2DQuadraticBezier& rCurve, - double distanceBounds ) + double distanceBounds, + bool bAddEndPoint ) { // TODO return 0; |