summaryrefslogtreecommitdiffstats
path: root/src/display/inkscape-cairo.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-07-04 22:52:34 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-07-04 22:52:34 +0000
commit53e243dd44711327f8912970fd46d1a46269d328 (patch)
tree5df6d56bd48cfa27557aaf90bf2db7a97197debb /src/display/inkscape-cairo.cpp
parentconvert a path to guides using 2geom calls (diff)
downloadinkscape-53e243dd44711327f8912970fd46d1a46269d328.tar.gz
inkscape-53e243dd44711327f8912970fd46d1a46269d328.zip
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)
Diffstat (limited to 'src/display/inkscape-cairo.cpp')
-rw-r--r--src/display/inkscape-cairo.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp
index 9a114f48e..b67ac1311 100644
--- a/src/display/inkscape-cairo.cpp
+++ b/src/display/inkscape-cairo.cpp
@@ -10,7 +10,6 @@
#include <cairo.h>
-#include <typeinfo>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -160,9 +159,9 @@ feed_curve_to_cairo (cairo_t *ct, NArtBpath const *bpath, NR::Matrix trans, NR::
static void
feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix & trans, Geom::Rect view, bool optimize_stroke)
{
- if( typeid(c) == typeid(Geom::LineSegment) ||
- typeid(c) == typeid(Geom::HLineSegment) ||
- typeid(c) == typeid(Geom::VLineSegment) )
+ if( dynamic_cast<Geom::LineSegment const*>(&c) ||
+ dynamic_cast<Geom::HLineSegment const*>(&c) ||
+ dynamic_cast<Geom::VLineSegment const*>(&c) )
{
Geom::Point end_tr = c.finalPoint() * trans;
if (!optimize_stroke) {