summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2008-08-05 14:33:46 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2008-08-05 14:33:46 +0000
commit0651eb9e41d0e6680126456d6b7b665154ab7660 (patch)
tree794a0b30225009643ef882d51010bce5c8ae9cf8 /src/display
parentmore mockup on svgfonts dialog (diff)
downloadinkscape-0651eb9e41d0e6680126456d6b7b665154ab7660.tar.gz
inkscape-0651eb9e41d0e6680126456d6b7b665154ab7660.zip
Use is_straight_curve() instead of three separate dynamic casts
(bzr r6564)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/inkscape-cairo.cpp5
-rw-r--r--src/display/nr-arena-shape.cpp6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp
index d4a9f7062..8bc9eade2 100644
--- a/src/display/inkscape-cairo.cpp
+++ b/src/display/inkscape-cairo.cpp
@@ -27,6 +27,7 @@
#include <2geom/path.h>
#include <2geom/transforms.h>
#include <2geom/sbasis-to-bezier.h>
+#include "helper/geom-curves.h"
/** Creates a cairo context to render to the given pixblock on the given area */
cairo_t *
@@ -74,9 +75,7 @@ nr_create_cairo_context (NRRectL *area, NRPixBlock *pb)
static void
feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix const & trans, Geom::Rect view, bool optimize_stroke)
{
- if( dynamic_cast<Geom::LineSegment const*>(&c) ||
- dynamic_cast<Geom::HLineSegment const*>(&c) ||
- dynamic_cast<Geom::VLineSegment const*>(&c) )
+ if( is_straight_curve(c) )
{
Geom::Point end_tr = c.finalPoint() * trans;
if (!optimize_stroke) {
diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp
index 325681650..840f5044a 100644
--- a/src/display/nr-arena-shape.cpp
+++ b/src/display/nr-arena-shape.cpp
@@ -32,6 +32,7 @@
#include "prefs-utils.h"
#include "inkscape-cairo.h"
#include "helper/geom.h"
+#include "helper/geom-curves.h"
#include "sp-filter.h"
#include "sp-filter-reference.h"
#include "display/nr-filter.h"
@@ -428,10 +429,7 @@ static bool has_inner_area(Geom::PathVector const & pv) {
if ( (pv.size() == 1) && (pv.front().size() <= 1) ) {
// vector has only one path with only one segment, see if that's a non-curve segment: that would mean no internal region
- Geom::Curve const * c = & pv.front().front();
- if ( dynamic_cast<Geom::LineSegment const*>(c) ||
- dynamic_cast<Geom::HLineSegment const*>(c) ||
- dynamic_cast<Geom::VLineSegment const*>(c) )
+ if ( is_straight_curve(pv.front().front()) )
{
return false;
}