diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-11-03 23:02:08 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-11-03 23:02:08 +0000 |
| commit | 83f7ed76a1f5e92db4247ed4bb947fad591be50d (patch) | |
| tree | 0f13c63d32d0ed89fc082cf5a170ac85f22df003 /src | |
| parent | A bit remove of unnecesary code (diff) | |
| download | inkscape-83f7ed76a1f5e92db4247ed4bb947fad591be50d.tar.gz inkscape-83f7ed76a1f5e92db4247ed4bb947fad591be50d.zip | |
Update wrong variable name and apply the same way to select nodes to fillet/chamfer and BSpline, still the boring bug -ignore apply only to selected nodes- when document not in 'px'
(bzr r13668)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-bspline.cpp | 23 | ||||
| -rw-r--r-- | src/live_effects/lpe-bspline.h | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 22 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.h | 2 |
4 files changed, 25 insertions, 25 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index 4f5ec2609..fcd01c3fb 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -427,14 +427,14 @@ void LPEBSpline::changeWeight(double weightValue) _("Modified the weight of the BSpline")); } -bool LPEBSpline::nodeIsSelected(Geom::Point nodePoint) +bool LPEBSpline::nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> selectedPoints) { using Geom::X; using Geom::Y; - if (points.size() > 0) { - for (std::vector<Geom::Point>::iterator i = points.begin(); - i != points.end(); ++i) { + if (selectedPoints.size() > 0) { + for (std::vector<Geom::Point>::iterator i = selectedPoints.begin(); + i != selectedPoints.end(); ++i) { Geom::Point p = *i; if (Geom::are_near(p, nodePoint, handleCubicGap)) { return true; @@ -450,19 +450,20 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) using Geom::X; using Geom::Y; SPDesktop *desktop = SP_ACTIVE_DESKTOP; + std::vector<Geom::Point> selectedPoints; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nt = INK_NODE_TOOL(desktop->event_context); Inkscape::UI::ControlPointSelection::Set &selection = nt->_selected_nodes->allPoints(); - points.clear(); + selectedPoints.clear(); std::vector<Geom::Point>::iterator pbegin; for (Inkscape::UI::ControlPointSelection::Set::iterator i = selection.begin(); i != selection.end(); ++i) { if ((*i)->selected()) { Inkscape::UI::Node *n = dynamic_cast<Inkscape::UI::Node *>(*i); - pbegin = points.begin(); - points.insert(pbegin, desktop->doc2dt(n->position())); + pbegin = selectedPoints.begin(); + selectedPoints.insert(pbegin, desktop->doc2dt(n->position())); } } } @@ -571,7 +572,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) } else { if (cubic) { if (!ignoreCusp || !Geom::are_near((*cubic)[1], pointAt0)) { - if (nodeIsSelected(pointAt0)) { + if (nodeIsSelected(pointAt0, selectedPoints)) { pointAt1 = SBasisIn.valueAt(weightValue); if (weightValue != noPower) { pointAt1 = @@ -584,7 +585,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) pointAt1 = in->first_segment()->initialPoint(); } if (!ignoreCusp || !Geom::are_near((*cubic)[2], pointAt3)) { - if (nodeIsSelected(pointAt3)) { + if (nodeIsSelected(pointAt3, selectedPoints)) { pointAt2 = SBasisIn.valueAt(1 - weightValue); if (weightValue != noPower) { pointAt2 = @@ -598,14 +599,14 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue) } } else { if (!ignoreCusp && weightValue != noPower) { - if (nodeIsSelected(pointAt0)) { + if (nodeIsSelected(pointAt0, selectedPoints)) { pointAt1 = SBasisIn.valueAt(weightValue); pointAt1 = Geom::Point(pointAt1[X] + handleCubicGap, pointAt1[Y] + handleCubicGap); } else { pointAt1 = in->first_segment()->initialPoint(); } - if (nodeIsSelected(pointAt3)) { + if (nodeIsSelected(pointAt3, selectedPoints)) { pointAt2 = SBasisIn.valueAt(weightValue); pointAt2 = Geom::Point(pointAt2[X] + handleCubicGap, pointAt2[Y] + handleCubicGap); diff --git a/src/live_effects/lpe-bspline.h b/src/live_effects/lpe-bspline.h index 169658b94..ca9ae06be 100644 --- a/src/live_effects/lpe-bspline.h +++ b/src/live_effects/lpe-bspline.h @@ -28,7 +28,7 @@ public: void drawHandle(Geom::Point p, double radiusHelperNodes); void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec); virtual void doBSplineFromWidget(SPCurve *curve, double value); - virtual bool nodeIsSelected(Geom::Point nodePoint); + virtual bool nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> selectedPoints); virtual Gtk::Widget *newWidget(); virtual void changeWeight(double weightValue); virtual void toDefaultWeight(Gtk::Widget *widgWeight); @@ -39,7 +39,6 @@ public: ScalarParam steps; private: - std::vector<Geom::Point> points; BoolParam ignoreCusp; BoolParam onlySelected; BoolParam showHelper; diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 240e2e2d9..da6819120 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -261,10 +261,10 @@ void LPEFilletChamfer::refreshKnots() } } -bool LPEFilletChamfer::nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> point) +bool LPEFilletChamfer::nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> selectedPoints) { - if (point.size() > 0) { - for (std::vector<Geom::Point>::iterator i = point.begin(); i != point.end(); + if (selectedPoints.size() > 0) { + for (std::vector<Geom::Point>::iterator i = selectedPoints.begin(); i != selectedPoints.end(); ++i) { Geom::Point p = *i; if (Geom::are_near(p, nodePoint, 2)) { @@ -276,7 +276,7 @@ bool LPEFilletChamfer::nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::P } void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pathv, double power) { - std::vector<Geom::Point> point; + std::vector<Geom::Point> selectedPoints; SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nodeTool = INK_NODE_TOOL(desktop->event_context); @@ -285,8 +285,8 @@ void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pa for (Inkscape::UI::ControlPointSelection::Set::iterator i = selection.begin(); i != selection.end(); ++i) { if ((*i)->selected()) { Inkscape::UI::Node *n = dynamic_cast<Inkscape::UI::Node *>(*i); - pBegin = point.begin(); - point.insert(pBegin, desktop->doc2dt(n->position())); + pBegin = selectedPoints.begin(); + selectedPoints.insert(pBegin, desktop->doc2dt(n->position())); } } } @@ -324,7 +324,7 @@ void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pa if (filletChamferData[counter][Y] == 0) { powerend = filletChamferData[counter][X]; } - if (only_selected && !nodeIsSelected(curve_it1->initialPoint(), point)) { + if (only_selected && !nodeIsSelected(curve_it1->initialPoint(), selectedPoints)) { powerend = filletChamferData[counter][X]; } result.push_back(Point(powerend, filletChamferData[counter][Y])); @@ -338,7 +338,7 @@ void LPEFilletChamfer::doUpdateFillet(std::vector<Geom::Path> const& original_pa void LPEFilletChamfer::doChangeType(std::vector<Geom::Path> const& original_pathv, int type) { - std::vector<Geom::Point> point; + std::vector<Geom::Point> selectedPoints; SPDesktop *desktop = SP_ACTIVE_DESKTOP; if (INK_IS_NODE_TOOL(desktop->event_context)) { Inkscape::UI::Tools::NodeTool *nodeTool = @@ -351,8 +351,8 @@ void LPEFilletChamfer::doChangeType(std::vector<Geom::Path> const& original_path i != selection.end(); ++i) { if ((*i)->selected()) { Inkscape::UI::Node *n = dynamic_cast<Inkscape::UI::Node *>(*i); - pBegin = point.begin(); - point.insert(pBegin, desktop->doc2dt(n->position())); + pBegin = selectedPoints.begin(); + selectedPoints.insert(pBegin, desktop->doc2dt(n->position())); } } } @@ -380,7 +380,7 @@ void LPEFilletChamfer::doChangeType(std::vector<Geom::Path> const& original_path (ignore_radius_0 && (filletChamferData[counter][X] == 0 || filletChamferData[counter][X] == counter)) || (only_selected && - !nodeIsSelected(curve_it1->initialPoint(), point))) { + !nodeIsSelected(curve_it1->initialPoint(), selectedPoints))) { toggle = false; } if (toggle) { diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h index 75d6b5f6b..25e619436 100644 --- a/src/live_effects/lpe-fillet-chamfer.h +++ b/src/live_effects/lpe-fillet-chamfer.h @@ -61,7 +61,7 @@ public: void updateFillet(); void doUpdateFillet(std::vector<Geom::Path> const& original_pathv, double power); void doChangeType(std::vector<Geom::Path> const& original_pathv, int type); - bool nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> points); + bool nodeIsSelected(Geom::Point nodePoint, std::vector<Geom::Point> selectedPoints); void refreshKnots(); FilletChamferPointArrayParam fillet_chamfer_values; |
