diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-07-04 22:52:34 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-07-04 22:52:34 +0000 |
| commit | 53e243dd44711327f8912970fd46d1a46269d328 (patch) | |
| tree | 5df6d56bd48cfa27557aaf90bf2db7a97197debb /src/helper/geom.cpp | |
| parent | convert a path to guides using 2geom calls (diff) | |
| download | inkscape-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/helper/geom.cpp')
| -rw-r--r-- | src/helper/geom.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp index 9ec21a44d..9b3b98894 100644 --- a/src/helper/geom.cpp +++ b/src/helper/geom.cpp @@ -160,9 +160,9 @@ bounds_exact_transformed(Geom::PathVector const & pv, Geom::Matrix const & t) for (Geom::Path::const_iterator cit = it->begin(); cit != it->end_open(); ++cit) {
Geom::Curve const &c = *cit;
- 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) )
{
bbox.expandTo( c.finalPoint() * t );
}
@@ -350,9 +350,9 @@ geom_curve_bbox_wind_distance(Geom::Curve const & c, Geom::Matrix const &m, Geom::Coord tolerance, Geom::Rect const *viewbox,
Geom::Point &p0) // pass p0 through as it represents the last endpoint added (the finalPoint of last curve)
{
- 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 pe = c.finalPoint() * m;
if (bbox) {
|
