summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-07-04 16:15:46 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-07-04 16:15:46 +0000
commit1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8 (patch)
treea91517f9165322b4e42c6cdeb4263beaedc4d02f /src/display
parentPackaging. New Win32 installer Danish translation. (diff)
parentUpgrade to 2Geom r2413 (diff)
downloadinkscape-1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8.tar.gz
inkscape-1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8.zip
Sync 2Geom to revision 2413.
May introduce regressions. (bzr r14226)
Diffstat (limited to 'src/display')
-rw-r--r--src/display/cairo-utils.cpp8
-rw-r--r--src/display/curve-test.h4
-rw-r--r--src/display/curve.cpp16
-rw-r--r--src/display/curve.h2
-rw-r--r--src/display/drawing-image.cpp2
5 files changed, 11 insertions, 21 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp
index e1f12b04b..59e190676 100644
--- a/src/display/cairo-utils.cpp
+++ b/src/display/cairo-utils.cpp
@@ -18,9 +18,7 @@
#include <glib/gstdio.h>
#include <glibmm/fileutils.h>
#include <2geom/pathvector.h>
-#include <2geom/bezier-curve.h>
-#include <2geom/elliptical-arc.h>
-#include <2geom/hvlinesegment.h>
+#include <2geom/curves.h>
#include <2geom/affine.h>
#include <2geom/point.h>
#include <2geom/path.h>
@@ -531,7 +529,7 @@ feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Affine const & tran
case 2:
{
Geom::QuadraticBezier const *quadratic_bezier = static_cast<Geom::QuadraticBezier const*>(&c);
- std::vector<Geom::Point> points = quadratic_bezier->points();
+ std::vector<Geom::Point> points = quadratic_bezier->controlPoints();
points[0] *= trans;
points[1] *= trans;
points[2] *= trans;
@@ -554,7 +552,7 @@ feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Affine const & tran
case 3:
{
Geom::CubicBezier const *cubic_bezier = static_cast<Geom::CubicBezier const*>(&c);
- std::vector<Geom::Point> points = cubic_bezier->points();
+ std::vector<Geom::Point> points = cubic_bezier->controlPoints();
//points[0] *= trans; // don't do this one here for fun: it is only needed for optimized strokes
points[1] *= trans;
points[2] *= trans;
diff --git a/src/display/curve-test.h b/src/display/curve-test.h
index 3d698ca07..34137f3c8 100644
--- a/src/display/curve-test.h
+++ b/src/display/curve-test.h
@@ -25,8 +25,8 @@ public:
path2.close();
// Open path
path3.append(Geom::SVGEllipticalArc(Geom::Point(4,0),1,2,M_PI,false,false,Geom::Point(5,1)));
- path3.append(Geom::VLineSegment(Geom::Point(5,1),2), Geom::Path::STITCH_DISCONTINUOUS);
- path3.append(Geom::HLineSegment(Geom::Point(6,4),2), Geom::Path::STITCH_DISCONTINUOUS);
+ path3.append(Geom::LineSegment(Geom::Point(5,1),Geom::Point(5,2)));
+ path3.append(Geom::LineSegment(Geom::Point(6,4),Geom::Point(2,4)));
}
virtual ~CurveTest() {}
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 54a62939d..d236d81cf 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -31,14 +31,12 @@
SPCurve::SPCurve()
: _refcount(1),
_pathv()
-{
-}
+{}
SPCurve::SPCurve(Geom::PathVector const& pathv)
: _refcount(1),
_pathv(pathv)
-{
-}
+{}
SPCurve *
SPCurve::new_from_rect(Geom::Rect const &rect, bool all_four_sides)
@@ -90,13 +88,7 @@ SPCurve::get_pathvector() const
size_t
SPCurve::get_segment_count() const
{
- size_t nr = 0;
- for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) {
- nr += (*it).size();
-
- if (it->closed()) nr += 1;
- }
- return nr;
+ return _pathv.curveCount();
}
/**
@@ -476,7 +468,7 @@ SPCurve::last_point() const
SPCurve *
SPCurve::create_reverse() const
{
- SPCurve *new_curve = new SPCurve(Geom::reverse_paths_and_order(_pathv));
+ SPCurve *new_curve = new SPCurve(_pathv.reversed());
return new_curve;
}
diff --git a/src/display/curve.h b/src/display/curve.h
index 5fad75b18..42b899210 100644
--- a/src/display/curve.h
+++ b/src/display/curve.h
@@ -13,7 +13,7 @@
#ifndef SEEN_DISPLAY_CURVE_H
#define SEEN_DISPLAY_CURVE_H
-#include <2geom/forward.h>
+#include <2geom/pathvector.h>
#include <cstddef>
#include <boost/optional.hpp>
diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp
index 8fe337959..1594614ac 100644
--- a/src/display/drawing-image.cpp
+++ b/src/display/drawing-image.cpp
@@ -172,7 +172,7 @@ static double
distance_to_segment (Geom::Point const &p, Geom::Point const &a1, Geom::Point const &a2)
{
Geom::LineSegment l(a1, a2);
- Geom::Point np = l.pointAt(l.nearestPoint(p));
+ Geom::Point np = l.pointAt(l.nearestTime(p));
return Geom::distance(np, p);
}