diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-02 23:02:48 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-02 23:02:48 +0000 |
| commit | f46112a60a24652fc35cc6746fc8f66e1c694389 (patch) | |
| tree | 676d5fb481c7cf2acadd99a4d375ec93c65703ff /src | |
| parent | add is_straight_curve in geom-curves.h helper file (diff) | |
| download | inkscape-f46112a60a24652fc35cc6746fc8f66e1c694389.tar.gz inkscape-f46112a60a24652fc35cc6746fc8f66e1c694389.zip | |
simplify lpe spiro code by using new "is_straight_curve" method
(bzr r6538)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-spiro.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/live_effects/lpe-spiro.cpp b/src/live_effects/lpe-spiro.cpp index 6a98e6d29..44ba32e4d 100644 --- a/src/live_effects/lpe-spiro.cpp +++ b/src/live_effects/lpe-spiro.cpp @@ -14,6 +14,7 @@ #include <2geom/bezier-curve.h> #include <2geom/hvlinesegment.h> #include "helper/geom-nodetype.h" +#include "helper/geom-curves.h" #include "live_effects/bezctx.h" #include "live_effects/bezctx_intf.h" @@ -154,12 +155,8 @@ LPESpiro::doEffect(SPCurve * curve) // Determine type of spiro node this is, determined by the tangents (angles) of the curves // TODO: see if this can be simplified by using /helpers/geom-nodetype.cpp:get_nodetype - bool this_is_line = ( dynamic_cast<Geom::LineSegment const *>(&*curve_it1) || - dynamic_cast<Geom::HLineSegment const *>(&*curve_it1) || - dynamic_cast<Geom::VLineSegment const *>(&*curve_it1) ); - bool next_is_line = ( dynamic_cast<Geom::LineSegment const *>(&*curve_it2) || - dynamic_cast<Geom::HLineSegment const *>(&*curve_it2) || - dynamic_cast<Geom::VLineSegment const *>(&*curve_it2) ); + bool this_is_line = is_straight_curve(*curve_it1); + bool next_is_line = is_straight_curve(*curve_it2); Geom::NodeType nodetype = Geom::get_nodetype(*curve_it1, *curve_it2); |
