summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a46807)
raw | patch | inline | side by side (parent: 5a46807)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Thu, 18 Feb 2010 00:22:55 +0000 (01:22 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Thu, 18 Feb 2010 00:22:55 +0000 (01:22 +0100) |
in the node tool
src/ui/tool/control-point-selection.h | patch | blob | history | |
src/ui/tool/path-manipulator.cpp | patch | blob | history |
index 48c25c2852ef62736e5914035734c608827bfc55..d982d6becd94588ec7bf2a0bd144801c9706d124 100644 (file)
namespace Inkscape {
namespace UI {
-class ControlPointSelection : public Manipulator {
+class ControlPointSelection : public Manipulator, public sigc::trackable {
public:
ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group);
~ControlPointSelection();
index d2f90bbca3dc180e0d145e9565831bca1feb4b1b..13f1448b93997984ca3188968a154461274118a3 100644 (file)
, _subpaths(*this)
, _multi_path_manipulator(mpm)
, _path(path)
- , _spcurve(NULL)
+ , _spcurve(new SPCurve())
, _dragpoint(new CurveDragPoint(*this))
, _observer(new PathManipulatorObserver(this, SP_OBJECT(path)->repr))
, _edit_transform(et)
delete _dragpoint;
delete _observer;
gtk_object_destroy(_outline);
- if (_spcurve) _spcurve->unref();
+ _spcurve->unref();
clear();
}
// so that _updateDragPoint doesn't crash on paths with naked movetos
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers(_spcurve->get_pathvector());
for (Geom::PathVector::iterator i = pathv.begin(); i != pathv.end(); ) {
- if (i->empty()) pathv.erase(i++);
- else ++i;
+ if (i->empty()) {
+ pathv.erase(i++);
+ } else {
+ ++i;
+ }
}
_spcurve->set_pathvector(pathv);
Effect *lpe = LIVEPATHEFFECT(_path)->get_lpe();
if (lpe) {
PathParam *pathparam = dynamic_cast<PathParam *>(lpe->getParameter(_lpe_key.data()));
- if (!_spcurve)
- _spcurve = new SPCurve(pathparam->get_pathvector());
- else
- _spcurve->set_pathvector(pathparam->get_pathvector());
+ _spcurve->unref();
+ _spcurve = new SPCurve(pathparam->get_pathvector());
}
} else {
- if (_spcurve) _spcurve->unref();
+ _spcurve->unref();
_spcurve = sp_path_get_curve_for_edit(_path);
}
}
}
} else {
if (_path->repr->attribute("inkscape:original-d"))
- sp_path_set_original_curve(_path, _spcurve, true, false);
+ sp_path_set_original_curve(_path, _spcurve, false, false);
else
sp_shape_set_curve(SP_SHAPE(_path), _spcurve, false);
}
* point of the path. */
void PathManipulator::_updateDragPoint(Geom::Point const &evp)
{
- // TODO find a way to make this faster (no transform required)
Geom::Matrix to_desktop = _edit_transform * _i2d_transform;
Geom::PathVector pv = _spcurve->get_pathvector();
boost::optional<Geom::PathVectorPosition> pvp