diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-16 21:36:19 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-16 21:36:19 +0000 |
| commit | 680344945f84364fbbcbe4d4a353a52d4a724653 (patch) | |
| tree | 1e8f541be4d451eff0e58ec6d76e066dd3167086 /src/2geom/svg-elliptical-arc.cpp | |
| parent | improving SVG Fonts UI (diff) | |
| download | inkscape-680344945f84364fbbcbe4d4a353a52d4a724653.tar.gz inkscape-680344945f84364fbbcbe4d4a353a52d4a724653.zip | |
update to latest 2geom (rev1497)
(bzr r6332)
Diffstat (limited to 'src/2geom/svg-elliptical-arc.cpp')
| -rw-r--r-- | src/2geom/svg-elliptical-arc.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/2geom/svg-elliptical-arc.cpp b/src/2geom/svg-elliptical-arc.cpp index 047ae1431..cdf60bc9f 100644 --- a/src/2geom/svg-elliptical-arc.cpp +++ b/src/2geom/svg-elliptical-arc.cpp @@ -915,10 +915,32 @@ D2<SBasis> SVGEllipticalArc::toSBasis() const SBasis arc_y = ray(Y) * sin(param,4); arc[0] = arc_x * cos_rot_angle - arc_y * sin_rot_angle + Linear(center(X),center(X)); arc[1] = arc_x * sin_rot_angle + arc_y * cos_rot_angle + Linear(center(Y),center(Y)); + + // ensure that endpoints remain exact + for ( int d = 0 ; d < 2 ; d++ ) { + arc[d][0][0] = initialPoint()[d]; + arc[d][0][1] = finalPoint()[d]; + } + return arc; } +Curve* SVGEllipticalArc::transformed(Matrix const& m) const +{ + // return SBasisCurve(toSBasis()).transformed(m); + + Ellipse e(center(X), center(Y), ray(X), ray(Y), rotation_angle()); + Ellipse et = e.transformed(m); + Point inner_point = pointAt(0.5); + SVGEllipticalArc ea = et.arc( initialPoint() * m, + inner_point * m, + finalPoint() * m, + is_svg_compliant() ); + return ea.duplicate(); +} + + Coord SVGEllipticalArc::map_to_02PI(Coord t) const { if ( sweep_flag() ) |
