summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2012-01-04 15:05:32 +0100
committerRadek Doulik <rodo@novell.com>2012-01-04 15:09:45 +0100
commit250f84daf8f443bf436e0a86c9a718c37749971a (patch)
treee6e1612aa72149e4ad6d1066c1d6cae22d55a317 /svx
parentd0bb67f5df45ed9ee1f152677d7104b7129052e8 (diff)
implemented QUADRATICCURVETO case of custom shape paths
- convert them to cubic beziers, which we have in basegfx
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 2b2078afdba8..0d9f9a38d73e 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1637,10 +1637,20 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
}
break;
- case QUADRATICCURVETO : // TODO
+ case QUADRATICCURVETO :
for ( sal_Int32 i(0L); ( i < nPntCount ) && ( rSrcPt + 1 < nCoordSize ); i++ )
{
- rSrcPt += 2;
+ const Point aControl(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
+ const Point aEnd(GetPoint( seqCoordinates[ rSrcPt++ ], sal_True, sal_True ));
+
+ basegfx::B2DPoint aStartPointB2D( aNewB2DPolygon.getB2DPoint(aNewB2DPolygon.count() - 1 ) );
+ Point aStartPoint( aStartPointB2D.getX(), aStartPointB2D.getY() );
+
+ DBG_ASSERT(aNewB2DPolygon.count(), "EnhancedCustomShape2d::CreateSubPath: Error in adding control point (!)");
+ aNewB2DPolygon.appendBezierSegment(
+ basegfx::B2DPoint(aStartPoint.X() + 2.0*(aControl.X() - aStartPoint.X())/3.0, aStartPoint.Y() + 2.0*(aControl.Y() - aStartPoint.Y())/3.0),
+ basegfx::B2DPoint(aEnd.X() + 2.0*(aControl.X() - aEnd.X())/3.0, aEnd.Y() + 2.0*(aControl.Y() - aEnd.Y())/3.0),
+ basegfx::B2DPoint(aEnd.X(), aEnd.Y()));
}
break;