diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-06-18 22:58:42 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-06-18 22:58:42 +0000 |
| commit | 6820ee49d69cd419c5e8d3c9de74b0552758c842 (patch) | |
| tree | 9d28789e1c620584983d48e28d6afe8411f396d6 /src/live_effects | |
| parent | fixing bug moving nodes (diff) | |
| download | inkscape-6820ee49d69cd419c5e8d3c9de74b0552758c842.tar.gz inkscape-6820ee49d69cd419c5e8d3c9de74b0552758c842.zip | |
Fixes when moves a path
(bzr r13645.1.163)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 13 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 24 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.h | 1 | ||||
| -rw-r--r-- | src/live_effects/parameter/satellitesarray.cpp | 1 |
4 files changed, 18 insertions, 21 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 7b36e30f9..5ac5e2407 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -421,6 +421,9 @@ Effect::getSelectedNodes() { size_t counter = 0; std::vector<size_t> result; + if (pathvector_before_effect.empty()){ + return result; + } for (size_t i = 0; i < pathvector_before_effect.size(); i++) { for (size_t j = 0; j < pathvector_before_effect[i].size_closed(); j++) { if ((!pathvector_before_effect[i].closed() && @@ -440,15 +443,11 @@ Effect::getSelectedNodes() bool Effect::isNodeSelected(Geom::Point const &node_point) const { - if (_selected_nodes_pos.size() > 0) { - using Geom::X; - using Geom::Y; - Geom::Affine transformCoordinate = sp_lpe_item->i2dt_affine(); + if (!_selected_nodes_pos.empty()) { for (std::vector<Geom::Point>::const_iterator i = _selected_nodes_pos.begin(); i != _selected_nodes_pos.end(); ++i) { - Geom::Point p = *i; - Geom::Point p2(node_point[X],node_point[Y]); - p2 *= transformCoordinate; + Geom::Point p = (*i); + Geom::Point p2(node_point[Geom::X],node_point[Geom::Y]); if (Geom::are_near(p, p2, 0.01)) { return true; } diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index c9d3d4afd..47b91bf03 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -258,26 +258,23 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) Geom::PathVector const pathv = pathv_to_linear_and_cubic_beziers(c->get_pathvector()); //if are diferent sizes call to poinwise recalculate //TODO: Update the satellite data in paths modified, Goal 0.93 + Satellites satellites = _satellites_param.data(); + if(satellites.empty()) { + doOnApply(lpeItem); + satellites = _satellites_param.data(); + } if (_pathvector_satellites) { size_t number_nodes = pathv.nodes().size(); - size_t previous_number_nodes = _pathvector_satellites->getPathVector().nodes().size(); + size_t previous_number_nodes = _pathvector_satellites->getTotalSatellites(); if (number_nodes != previous_number_nodes) { Satellite satellite(FILLET); satellite.setIsTime(_flexible); satellite.setHasMirror(_mirror_knots); satellite.setHidden(_hide_knots); _pathvector_satellites->recalculateForNewPathVector(pathv, satellite); - _pathvector_satellites->setSelected(getSelectedNodes()); - _satellites_param.setPathVectorSatellites(_pathvector_satellites); - refreshKnots(); - return; + satellites = _pathvector_satellites->getSatellites(); } } - Satellites satellites = _satellites_param.data(); - if(satellites.empty()) { - doOnApply(lpeItem); - satellites = _satellites_param.data(); - } if (_degenerate_hide) { _satellites_param.setGlobalKnotHide(true); } else { @@ -311,7 +308,9 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) satellites[i][j].hidden = _hide_knots; } } - _pathvector_satellites = new PathVectorSatellites(); + if (!_pathvector_satellites) { + _pathvector_satellites = new PathVectorSatellites(); + } _pathvector_satellites->setPathVector(pathv); _pathvector_satellites->setSatellites(satellites); _pathvector_satellites->setSelected(getSelectedNodes()); @@ -378,8 +377,7 @@ LPEFilletChamfer::doEffect_path(Geom::PathVector const &path_in) } Geom::Curve const &curve_it2 = pathv[path][next_index]; Satellite satellite = satellites[path][next_index]; - if (Geom::are_near((*curve_it1).initialPoint(), (*curve_it1).finalPoint()) || - Geom::are_near(curve_it2.initialPoint(), curve_it2.finalPoint())) { + if (Geom::are_near((*curve_it1).initialPoint(), (*curve_it1).finalPoint())) { _degenerate_hide = true; g_warning("Knots hidded if consecutive nodes has the same position."); return path_in; diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h index 134886950..d3f437afd 100644 --- a/src/live_effects/lpe-fillet-chamfer.h +++ b/src/live_effects/lpe-fillet-chamfer.h @@ -16,6 +16,7 @@ #include "live_effects/parameter/satellitesarray.h" #include "live_effects/effect.h" #include "helper/geom-pathvectorsatellites.h" +#include "helper/geom-satellite.h" namespace Inkscape { namespace LivePathEffect { diff --git a/src/live_effects/parameter/satellitesarray.cpp b/src/live_effects/parameter/satellitesarray.cpp index 8c86f64ca..d4182d459 100644 --- a/src/live_effects/parameter/satellitesarray.cpp +++ b/src/live_effects/parameter/satellitesarray.cpp @@ -81,7 +81,6 @@ void SatellitesArrayParam::setHelperSize(int hs) void SatellitesArrayParam::updateCanvasIndicators(bool mirror) { - if (!_last_pathvector_satellites) { return; } |
