From 53e243dd44711327f8912970fd46d1a46269d328 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Jul 2008 22:52:34 +0000 Subject: use if(dynamic_cast<>) instead of if(typeid==) to check 2geom segment types for straightlines. this because the closing line segment is special class ClosingSegment : public LineSegment. (bzr r6158) --- src/livarot/PathCutting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/livarot/PathCutting.cpp') diff --git a/src/livarot/PathCutting.cpp b/src/livarot/PathCutting.cpp index 718017851..1ab2faf60 100644 --- a/src/livarot/PathCutting.cpp +++ b/src/livarot/PathCutting.cpp @@ -411,11 +411,11 @@ void* Path::MakeArtBPath(void) void Path::AddCurve(Geom::Curve const &c) { - if( typeid(c) == typeid(Geom::LineSegment) || - typeid(c) == typeid(Geom::HLineSegment) || - typeid(c) == typeid(Geom::VLineSegment) ) + if( dynamic_cast(&c) || + dynamic_cast(&c) || + dynamic_cast(&c) ) { - LineTo( to_2geom(c.finalPoint()) ); + LineTo( from_2geom(c.finalPoint()) ); } /* else if(Geom::QuadraticBezier const *quadratic_bezier = dynamic_cast(c)) { -- cgit v1.2.3