From a7f2b2ba3f13ceb60376802f4a31e104153839e8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Feb 2015 03:00:37 +0100 Subject: At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems" So, i tried that. And I will continue tomorrow, and the days after, on and on. (bzr r13922.1.1) --- src/object-snapper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 338f91463..960b5087b 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -237,8 +237,9 @@ void Inkscape::ObjectSnapper::_collectNodes(SnapSourceType const &t, // current selection (see the comment in SelTrans::centerRequest()) bool old_pref2 = _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_ROTATION_CENTER); if (old_pref2) { - for ( GSList const *itemlist = _snapmanager->getRotationCenterSource(); itemlist != NULL; itemlist = g_slist_next(itemlist) ) { - if ((*i).item == reinterpret_cast(itemlist->data)) { + SelContainer rotationSource=_snapmanager->getRotationCenterSource(); + for ( SelContainer::const_iterator itemlist=rotationSource.begin();itemlist!=rotationSource.end();itemlist++) { + if ((*i).item == reinterpret_cast(*itemlist)) { // don't snap to this item's rotation center _snapmanager->snapprefs.setTargetSnappable(SNAPTARGET_ROTATION_CENTER, false); break; -- cgit v1.2.3 From 5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Feb 2015 04:25:21 +0100 Subject: Put a few std::vector (bzr r13922.1.5) --- src/object-snapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 960b5087b..830c3c1db 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -237,8 +237,8 @@ void Inkscape::ObjectSnapper::_collectNodes(SnapSourceType const &t, // current selection (see the comment in SelTrans::centerRequest()) bool old_pref2 = _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_ROTATION_CENTER); if (old_pref2) { - SelContainer rotationSource=_snapmanager->getRotationCenterSource(); - for ( SelContainer::const_iterator itemlist=rotationSource.begin();itemlist!=rotationSource.end();itemlist++) { + std::vector rotationSource=_snapmanager->getRotationCenterSource(); + for ( std::vector::const_iterator itemlist=rotationSource.begin();itemlist!=rotationSource.end();itemlist++) { if ((*i).item == reinterpret_cast(*itemlist)) { // don't snap to this item's rotation center _snapmanager->snapprefs.setTargetSnappable(SNAPTARGET_ROTATION_CENTER, false); -- cgit v1.2.3 From 9a7fa4d1899d30ec745107823f307b2a0bf3172f Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 27 Feb 2015 03:10:36 +0100 Subject: corrected the casts (hopefully) (bzr r13922.1.10) --- src/object-snapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 830c3c1db..f9c189c58 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -238,8 +238,8 @@ void Inkscape::ObjectSnapper::_collectNodes(SnapSourceType const &t, bool old_pref2 = _snapmanager->snapprefs.isTargetSnappable(SNAPTARGET_ROTATION_CENTER); if (old_pref2) { std::vector rotationSource=_snapmanager->getRotationCenterSource(); - for ( std::vector::const_iterator itemlist=rotationSource.begin();itemlist!=rotationSource.end();itemlist++) { - if ((*i).item == reinterpret_cast(*itemlist)) { + for ( std::vector::const_iterator itemlist = rotationSource.begin(); itemlist != rotationSource.end(); itemlist++) { + if ((*i).item == *itemlist) { // don't snap to this item's rotation center _snapmanager->snapprefs.setTargetSnappable(SNAPTARGET_ROTATION_CENTER, false); break; -- cgit v1.2.3 From c883d7627a479c8c5b6a9f77b9841fa5631572ad Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Mon, 27 Apr 2015 19:39:29 -0400 Subject: 2Geom sync - initial commit (bzr r14059.2.1) --- src/object-snapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 338f91463..3f8d4a662 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -516,14 +516,14 @@ void Inkscape::ObjectSnapper::_snapPaths(IntermSnapResults &isr, for(Geom::PathVector::iterator it_pv = (it_p->path_vector)->begin(); it_pv != (it_p->path_vector)->end(); ++it_pv) { // Find a nearest point for each curve within this path // n curves will return n time values with 0 <= t <= 1 - std::vector anp = (*it_pv).nearestPointPerCurve(p_doc); + std::vector anp = (*it_pv).nearestTimePerCurve(p_doc); //std::cout << "#nearest points = " << anp.size() << " | p = " << p.getPoint() << std::endl; // Now we will examine each of the nearest points, and determine whether it's within snapping range and if we should snap to it std::vector::const_iterator np = anp.begin(); unsigned int index = 0; for (; np != anp.end(); ++np, index++) { - Geom::Curve const *curve = &((*it_pv).at_index(index)); + Geom::Curve const *curve = &(it_pv->at(index)); Geom::Point const sp_doc = curve->pointAt(*np); //dt->snapindicator->set_new_debugging_point(sp_doc*dt->doc2dt()); bool c1 = true; @@ -622,7 +622,7 @@ void Inkscape::ObjectSnapper::_snapPathsConstrained(IntermSnapResults &isr, // PS: Because the paths we're about to snap to are all expressed relative to document coordinate system, we will have // to convert the snapper coordinates from the desktop coordinates to document coordinates - std::vector constraint_path; + Geom::PathVector constraint_path; if (c.isCircular()) { Geom::Circle constraint_circle(dt->dt2doc(c.getPoint()), c.getRadius()); constraint_circle.getPath(constraint_path); -- cgit v1.2.3 From 25fa09178b7d0d0befa708e93ea5316ef381caa0 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 22 May 2015 10:23:27 +0200 Subject: Update to 2Geom revision 2396 (bzr r14059.2.16) --- src/object-snapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/object-snapper.cpp') diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 1293d19aa..634d56aa6 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -19,6 +19,7 @@ #include <2geom/rect.h> #include <2geom/line.h> #include <2geom/circle.h> +#include <2geom/path-sink.h> #include "document.h" #include "sp-namedview.h" #include "sp-image.h" @@ -626,7 +627,10 @@ void Inkscape::ObjectSnapper::_snapPathsConstrained(IntermSnapResults &isr, Geom::PathVector constraint_path; if (c.isCircular()) { Geom::Circle constraint_circle(dt->dt2doc(c.getPoint()), c.getRadius()); - constraint_circle.getPath(constraint_path); + Geom::PathBuilder pb; + pb.feed(constraint_circle); + pb.flush(); + constraint_path = pb.peek(); } else { Geom::Path constraint_line; constraint_line.start(p_min_on_cl); -- cgit v1.2.3