From 2024224a4ee351841f50a6f7b8a267f605a17096 Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Thu, 17 Apr 2014 01:45:58 +1000 Subject: Move bezier functions Move ImplSubdivideBezier(Polygon) to Polygon as a static function. Move ImplSubdivideBezier(PolyPolygon) to PolyPolygon as a static function. Change-Id: I0d006a8a2d3a8d9ba1aec913ceecb38507e4dd2f --- tools/source/generic/poly.cxx | 12 ++++++++++++ tools/source/generic/poly2.cxx | 11 +++++++++++ 2 files changed, 23 insertions(+) (limited to 'tools') diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index c2377953d5e4..f9a23a91f694 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -277,6 +277,18 @@ void ImplPolygon::ImplCreateFlagArray() } } + +Polygon Polygon::SubdivideBezier( const Polygon& rPoly ) +{ + Polygon aPoly; + + // #100127# Use adaptive subdivide instead of fixed 25 segments + rPoly.AdaptiveSubdivide( aPoly ); + + return aPoly; +} + + inline void Polygon::ImplMakeUnique() { // copy references if any exist diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index 3804cdb29114..4bff3622518d 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -295,6 +295,17 @@ void PolyPolygon::AdaptiveSubdivide( PolyPolygon& rResult, const double d ) cons } } +PolyPolygon PolyPolygon::SubdivideBezier( const PolyPolygon& rPolyPoly ) +{ + sal_uInt16 i, nPolys = rPolyPoly.Count(); + PolyPolygon aPolyPoly( nPolys ); + for( i=0; i