diff options
| author | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
|---|---|---|
| committer | Michael Soegtrop <MSoegtrop@yahoo.de> | 2017-06-05 13:01:17 +0000 |
| commit | e7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch) | |
| tree | 9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/ui/tool | |
| parent | updated to latest trunk (diff) | |
| parent | [Bug #1695016] Xaml export misses some radialGradients. (diff) | |
| download | inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip | |
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/ui/tool')
| -rw-r--r-- | src/ui/tool/Makefile_insert | 30 | ||||
| -rw-r--r-- | src/ui/tool/control-point-selection.cpp | 1 | ||||
| -rw-r--r-- | src/ui/tool/control-point.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/curve-drag-point.cpp | 3 | ||||
| -rw-r--r-- | src/ui/tool/manipulator.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tool/modifier-tracker.cpp | 1 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.h | 15 | ||||
| -rw-r--r-- | src/ui/tool/node.cpp | 15 | ||||
| -rw-r--r-- | src/ui/tool/node.h | 5 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 32 | ||||
| -rw-r--r-- | src/ui/tool/selector.cpp | 1 | ||||
| -rw-r--r-- | src/ui/tool/transform-handle-set.cpp | 9 |
13 files changed, 29 insertions, 91 deletions
diff --git a/src/ui/tool/Makefile_insert b/src/ui/tool/Makefile_insert deleted file mode 100644 index f46f48b72..000000000 --- a/src/ui/tool/Makefile_insert +++ /dev/null @@ -1,30 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -ink_common_sources += \ - ui/tool/control-point.cpp \ - ui/tool/control-point.h \ - ui/tool/control-point-selection.cpp \ - ui/tool/control-point-selection.h \ - ui/tool/commit-events.h \ - ui/tool/curve-drag-point.cpp \ - ui/tool/curve-drag-point.h \ - ui/tool/event-utils.cpp \ - ui/tool/event-utils.h \ - ui/tool/manipulator.cpp \ - ui/tool/manipulator.h \ - ui/tool/modifier-tracker.cpp \ - ui/tool/modifier-tracker.h \ - ui/tool/multi-path-manipulator.cpp \ - ui/tool/multi-path-manipulator.h \ - ui/tool/node.cpp \ - ui/tool/node.h \ - ui/tool/node-types.h \ - ui/tool/path-manipulator.cpp \ - ui/tool/path-manipulator.h \ - ui/tool/selectable-control-point.cpp \ - ui/tool/selectable-control-point.h \ - ui/tool/selector.cpp \ - ui/tool/selector.h \ - ui/tool/shape-record.h \ - ui/tool/transform-handle-set.cpp \ - ui/tool/transform-handle-set.h diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index f36ad7374..a5611addc 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -13,7 +13,6 @@ #include "ui/tool/selectable-control-point.h" #include <2geom/transforms.h> #include "desktop.h" -#include "preferences.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" #include "ui/tool/transform-handle-set.h" diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index 636595016..d9374c790 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -16,8 +16,6 @@ #include "display/snap-indicator.h" #include "ui/tools/tool-base.h" #include "message-context.h" -#include "preferences.h" -#include "snap-preferences.h" #include "sp-namedview.h" #include "ui/control-manager.h" #include "ui/tool/control-point.h" diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index e460b0fb7..908e18474 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -8,15 +8,12 @@ #include "ui/tool/curve-drag-point.h" #include <glib/gi18n.h> -#include <2geom/bezier-curve.h> #include "desktop.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" -#include "ui/tool/node.h" #include "sp-namedview.h" -#include "snap.h" namespace Inkscape { namespace UI { diff --git a/src/ui/tool/manipulator.cpp b/src/ui/tool/manipulator.cpp index 11dd220f4..82ff014e4 100644 --- a/src/ui/tool/manipulator.cpp +++ b/src/ui/tool/manipulator.cpp @@ -8,8 +8,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "ui/tool/node.h" -#include "ui/tool/manipulator.h" +//#include "ui/tool/node.h" +//#include "ui/tool/manipulator.h" namespace Inkscape { namespace UI { diff --git a/src/ui/tool/modifier-tracker.cpp b/src/ui/tool/modifier-tracker.cpp index cc4e4d0b2..f502acab2 100644 --- a/src/ui/tool/modifier-tracker.cpp +++ b/src/ui/tool/modifier-tracker.cpp @@ -12,7 +12,6 @@ #include <gdk/gdkkeysyms.h> #include "ui/tool/event-utils.h" #include "ui/tool/modifier-tracker.h" -#include <gtk/gtk.h> namespace Inkscape { namespace UI { diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 9ec6f733f..f30c7e349 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -19,13 +19,11 @@ #include "document-undo.h" #include "live_effects/lpeobject.h" #include "message-stack.h" -#include "preferences.h" #include "sp-path.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" #include "ui/tool/multi-path-manipulator.h" #include "ui/tool/path-manipulator.h" -#include "util/unordered-containers.h" #include "verbs.h" #include <gdk/gdkkeysyms.h> diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h index c908cede2..4f152e0a2 100644 --- a/src/ui/tool/multi-path-manipulator.h +++ b/src/ui/tool/multi-path-manipulator.h @@ -82,8 +82,19 @@ private: template <typename R> void invokeForAll(R (PathManipulator::*method)()) { - for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) { - ((i->second.get())->*method)(); + for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ) { + // Sometimes the PathManipulator got freed at loop end, thus + // invalidating the iterator so make sure that next_i will + // be a valid iterator and then assign i to it. + MapType::iterator next_i = i; + ++next_i; + // i->second is a boost::shared_ptr so try to hold on to it so + // it won't get freed prematurely by the WriteXML() method or + // whatever. See https://bugs.launchpad.net/inkscape/+bug/1617615 + // Applicable to empty paths. + boost::shared_ptr<PathManipulator> hold(i->second); + ((hold.get())->*method)(); + i = next_i; } } template <typename R, typename A> diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 9268d9730..d6e491ac3 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -12,25 +12,20 @@ #include "multi-path-manipulator.h" #include <glib/gi18n.h> #include <2geom/bezier-utils.h> -#include <2geom/transforms.h> #include "display/sp-ctrlline.h" #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "desktop.h" -#include "preferences.h" #include "snap.h" -#include "snap-preferences.h" #include "sp-namedview.h" #include "ui/control-manager.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/event-utils.h" -#include "ui/tool/node.h" #include "ui/tool/path-manipulator.h" #include "ui/tools/node-tool.h" #include "ui/tools-switch.h" #include <gdk/gdkkeysyms.h> -#include <cmath> namespace { @@ -331,10 +326,7 @@ bool Handle::grabbed(GdkEventMotion *) void Handle::dragged(Geom::Point &new_pos, GdkEventMotion *event) { - if (tools_isactive(_desktop, TOOLS_NODES)) { - Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(_desktop->event_context); - nt->update_helperpath(); - } + Inkscape::UI::Tools::sp_update_helperpath(); Geom::Point parent_pos = _parent->position(); Geom::Point origin = _last_drag_origin(); SnapManager &sm = _desktop->namedview->snap_manager; @@ -1204,10 +1196,7 @@ bool Node::grabbed(GdkEventMotion *event) void Node::dragged(Geom::Point &new_pos, GdkEventMotion *event) { - if (tools_isactive(_desktop, TOOLS_NODES)) { - Inkscape::UI::Tools::NodeTool *nt = static_cast<Inkscape::UI::Tools::NodeTool*>(_desktop->event_context); - nt->update_helperpath(); - } + Inkscape::UI::Tools::sp_update_helperpath(); // For a note on how snapping is implemented in Inkscape, see snap.h. SnapManager &sm = _desktop->namedview->snap_manager; // even if we won't really snap, we might still call the one of the diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h index 025c460e2..a05f0e3b9 100644 --- a/src/ui/tool/node.h +++ b/src/ui/tool/node.h @@ -20,12 +20,7 @@ #include <iosfwd> #include <stdexcept> #include <cstddef> - -#if __cplusplus >= 201103L #include <functional> -#else -#include <tr1/functional> -#endif #include <boost/enable_shared_from_this.hpp> #include <boost/shared_ptr.hpp> diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index de071dad3..f2899dd01 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -12,37 +12,23 @@ #include "live_effects/lpe-powerstroke.h" #include "live_effects/lpe-bspline.h" -#include "live_effects/lpe-fillet-chamfer.h" -#include <string> -#include <sstream> -#include <deque> -#include <stdexcept> -#include <boost/shared_ptr.hpp> -#include <2geom/bezier-curve.h> #include <2geom/bezier-utils.h> #include <2geom/path-sink.h> -#include <glibmm/i18n.h> #include "ui/tool/path-manipulator.h" -#include "desktop.h" #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "display/curve.h" #include "display/canvas-bpath.h" -#include "document.h" -#include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" #include "live_effects/parameter/path.h" -#include "sp-path.h" #include "helper/geom.h" -#include "preferences.h" #include "style.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/curve-drag-point.h" #include "ui/tool/event-utils.h" #include "ui/tool/multi-path-manipulator.h" -#include "xml/node.h" #include "xml/node-observer.h" namespace Inkscape { @@ -1377,13 +1363,6 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE) lpe_pwr->adjustForNewPath(pathv); } } - this_effect = _path->getPathEffectOfType(Inkscape::LivePathEffect::FILLET_CHAMFER); - if(this_effect){ - LivePathEffect::LPEFilletChamfer *lpe_fll = dynamic_cast<LivePathEffect::LPEFilletChamfer*>(this_effect->getLPEObj()->get_lpe()); - if (lpe_fll) { - lpe_fll->adjustForNewPath(pathv); - } - } } } @@ -1505,11 +1484,14 @@ void PathManipulator::_setGeometry() } } else { if (empty()) return; - //XML Tree being used here directly while it shouldn't be. - if (_path->getRepr()->attribute("inkscape:original-d")) - _path->set_original_curve(_spcurve, false, false); - else + if (SPCurve * original = _path->get_original_curve()){ + if(!_spcurve->is_equal(original)) { + _path->set_original_curve(_spcurve, false, false); + delete original; + } + } else if(!_spcurve->is_equal(_path->get_curve())) { _path->setCurve(_spcurve, false); + } } } diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index 9acf7de88..84e96173d 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -14,7 +14,6 @@ #include "display/sodipodi-ctrlrect.h" #include "ui/tools/tool-base.h" -#include "preferences.h" #include "ui/tool/event-utils.h" #include "ui/tool/selector.h" diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 748b9d4cc..083a7d0ba 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -18,11 +18,7 @@ #include "sp-namedview.h" #include "display/sodipodi-ctrlrect.h" -#include "preferences.h" #include "pure-transform.h" -#include "snap.h" -#include "snap-candidate.h" -#include "sp-namedview.h" #include "ui/tool/commit-events.h" #include "ui/tool/control-point-selection.h" #include "ui/tool/selectable-control-point.h" @@ -187,6 +183,11 @@ void TransformHandle::ungrabbed(GdkEventButton *) _setState(_state); endTransform(); _th.signal_commit.emit(getCommitEvent()); + + //updates the positions of the nodes + Inkscape::UI::Tools::NodeTool *nt = INK_NODE_TOOL(_th._desktop->event_context); + ControlPointSelection* selection = nt->_selected_nodes; + selection->setOriginalPoints(); } |
