From 31bb8269c26a781036448ed8f8cd93cc84fb2118 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 29 Nov 2009 16:33:18 +0100 Subject: First GSoC node tool commit to Bazaar (bzr r8846.1.1) --- src/2geom/chebyshev.cpp | 2 +- src/2geom/svg-path-parser.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/2geom') diff --git a/src/2geom/chebyshev.cpp b/src/2geom/chebyshev.cpp index 447c5183f..73baf7b6b 100644 --- a/src/2geom/chebyshev.cpp +++ b/src/2geom/chebyshev.cpp @@ -93,7 +93,7 @@ SBasis chebyshev_approximant_interpolating (double (*f)(double,void*), wr.fa = fa; wr.fb = fb; wr.in = in; - printf("%f %f\n", fa, fb); + //printf("%f %f\n", fa, fb); wr.f = f; wr.pp = p; return compose(Linear(in[0], in[1]), Linear(fa, fb)) + chebyshev_approximant(f_interp, order, in, &wr) + Linear(fa, fb); diff --git a/src/2geom/svg-path-parser.cpp b/src/2geom/svg-path-parser.cpp index 071b171b3..691ddf022 100644 --- a/src/2geom/svg-path-parser.cpp +++ b/src/2geom/svg-path-parser.cpp @@ -1,4 +1,3 @@ -#line 1 "/home/njh/svn/lib2geom/src/2geom/svg-path-parser.rl" /** * \file * \brief parse SVG path specifications -- cgit v1.2.3 From b52865a71a9f83da9719a3ec5f50a4a2cd7cdace Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 10 Jan 2010 01:46:28 +0100 Subject: * Implement node snapping. * Fix minor bug in linear grow. * Add --fixes. * Move some node selection-related functions to ControlPointSelection. Fixed bugs: - https://launchpad.net/bugs/170561 - https://launchpad.net/bugs/171893 - https://launchpad.net/bugs/182585 - https://launchpad.net/bugs/446773 (bzr r8846.2.9) --- src/2geom/path.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/2geom') diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 981c9f044..88c7a99b9 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -203,11 +203,10 @@ Path::nearestPointPerCurve(Point const& _point) const { //return a single nearest point for each curve in this path std::vector np; - const Path& _path = *this; - for (Sequence::const_iterator it = _path.get_curves().begin() ; it != _path.get_curves().end()-1 ; ++it) + for (const_iterator it = begin() ; it != end_default(); ++it) //for (std::vector::const_iterator it = _path.begin(); it != _path.end(), ++it){ { - np.push_back((*it)->nearestPoint(_point)); + np.push_back(it->nearestPoint(_point)); } return np; } -- cgit v1.2.3 From a19670da5137c1403f53f4a9725248acc8459950 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Feb 2010 02:22:44 +0100 Subject: Fix path transformation (LP bug #515237) Fixed bugs: - https://launchpad.net/bugs/515237 (bzr r9062) --- src/2geom/hvlinesegment.h | 4 ++-- src/2geom/path.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'src/2geom') diff --git a/src/2geom/hvlinesegment.h b/src/2geom/hvlinesegment.h index ac91ec80a..6c42b06aa 100644 --- a/src/2geom/hvlinesegment.h +++ b/src/2geom/hvlinesegment.h @@ -216,7 +216,7 @@ class HLineSegment : public Curve { Point ip = initialPoint() * m; Point ep = finalPoint() * m; - if (m.onlyScaleAndTranslation()) { + if (ip[Y] == ep[Y]) { return new HLineSegment(ip[X], ep[X], ip[Y]); } else { return new LineSegment(ip, ep); @@ -457,7 +457,7 @@ class VLineSegment : public Curve { Point ip = initialPoint() * m; Point ep = finalPoint() * m; - if (m.onlyScaleAndTranslation()) { + if (ip[X] == ep[X]) { return new VLineSegment(ip[X], ip[Y], ep[Y]); } else { return new LineSegment(ip, ep); diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 88c7a99b9..05a69d616 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -89,8 +89,17 @@ Path &Path::operator*=(Matrix const &m) { } prev = (*it)->finalPoint(); } - for ( int i = 0 ; i < 2 ; ++i ) { - final_->setPoint(i, (*final_)[i] * m); + if (closed_) { + Geom::Point pt = front().initialPoint(); + if (size_open() > 0) { + Curve *l = const_cast((get_curves().end() - 2)->get()); + l->setFinal(pt); + } + final_->setInitial(pt); + final_->setFinal(pt); + } else { + final_->setInitial(back().finalPoint()); + final_->setFinal(front().initialPoint()); } if (get_curves().size() > 1) { if ( front().initialPoint() != initialPoint() || back().finalPoint() != finalPoint() ) { -- cgit v1.2.3 From 1393823719e4fa4377e9f71f29dae608c89222fe Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Feb 2010 03:20:50 +0100 Subject: Revert fix for 515237 which introduces a catastrophic bug (bzr r9064) --- src/2geom/path.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/2geom') diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 05a69d616..88c7a99b9 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -89,17 +89,8 @@ Path &Path::operator*=(Matrix const &m) { } prev = (*it)->finalPoint(); } - if (closed_) { - Geom::Point pt = front().initialPoint(); - if (size_open() > 0) { - Curve *l = const_cast((get_curves().end() - 2)->get()); - l->setFinal(pt); - } - final_->setInitial(pt); - final_->setFinal(pt); - } else { - final_->setInitial(back().finalPoint()); - final_->setFinal(front().initialPoint()); + for ( int i = 0 ; i < 2 ; ++i ) { + final_->setPoint(i, (*final_)[i] * m); } if (get_curves().size() > 1) { if ( front().initialPoint() != initialPoint() || back().finalPoint() != finalPoint() ) { -- cgit v1.2.3