diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-01-16 16:18:45 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-01-16 16:18:45 +0000 |
| commit | 03cb69220632b0c674efff5be3aab8be35d23eff (patch) | |
| tree | 464a1f74c57b796604ceb38c1687d579d2891800 /src/ui/tool | |
| parent | update to trunk (diff) | |
| parent | Test implementation of 'shape-padding'. (diff) | |
| download | inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.tar.gz inkscape-03cb69220632b0c674efff5be3aab8be35d23eff.zip | |
update to trunk
(bzr r13708.1.7)
Diffstat (limited to 'src/ui/tool')
| -rw-r--r-- | src/ui/tool/control-point.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tool/curve-drag-point.cpp | 18 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 8 | ||||
| -rw-r--r-- | src/ui/tool/node.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tool/path-manipulator.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tool/selector.cpp | 6 | ||||
| -rw-r--r-- | src/ui/tool/transform-handle-set.cpp | 4 |
7 files changed, 36 insertions, 18 deletions
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index e98c7b2a2..bcf5c9fce 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -11,7 +11,7 @@ #include <gdkmm.h> #include <2geom/point.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/sp-canvas.h" #include "display/snap-indicator.h" #include "ui/tools/tool-base.h" @@ -74,7 +74,7 @@ ControlPoint::ControlPoint(SPDesktop *d, Geom::Point const &initial_pos, SPAncho _lurking(false) { _canvas_item = sp_canvas_item_new( - group ? group : sp_desktop_controls(_desktop), SP_TYPE_CTRL, + group ? group : _desktop->getControls(), SP_TYPE_CTRL, "anchor", (SPAnchorType) anchor, "size", (gdouble) pixbuf->get_width(), "shape", SP_CTRL_SHAPE_BITMAP, "pixbuf", pixbuf->gobj(), "filled", TRUE, "fill_color", _cset.normal.fill, @@ -93,7 +93,7 @@ ControlPoint::ControlPoint(SPDesktop *d, Geom::Point const &initial_pos, SPAncho _position(initial_pos), _lurking(false) { - _canvas_item = ControlManager::getManager().createControl(group ? group : sp_desktop_controls(_desktop), type); + _canvas_item = ControlManager::getManager().createControl(group ? group : _desktop->getControls(), type); g_object_set(_canvas_item, "anchor", anchor, "filled", TRUE, "fill_color", _cset.normal.fill, diff --git a/src/ui/tool/curve-drag-point.cpp b/src/ui/tool/curve-drag-point.cpp index 013553410..49c949107 100644 --- a/src/ui/tool/curve-drag-point.cpp +++ b/src/ui/tool/curve-drag-point.cpp @@ -94,8 +94,22 @@ void CurveDragPoint::dragged(Geom::Point &new_pos, GdkEventMotion *event) if(!_pm.isBSpline(false)){ first->front()->move(first->front()->position() + offset0); second->back()->move(second->back()->position() + offset1); - }else if(weight>=0.8 && held_shift(*event))second->back()->move(new_pos); - else if(weight<=0.2 && held_shift(*event))first->front()->move(new_pos); + }else if(weight>=0.8){ + if(held_shift(*event)){ + second->back()->move(new_pos); + } else { + second->move(second->position() + delta); + } + }else if(weight<=0.2){ + if(held_shift(*event)){ + first->back()->move(new_pos); + } else { + first->move(first->position() + delta); + } + }else{ + first->move(first->position() + delta); + second->move(second->position() + delta); + } _pm.update(); } diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index d7b35c974..f53cef5f4 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -14,7 +14,7 @@ #include "node.h" #include <glibmm/i18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "live_effects/lpeobject.h" @@ -820,9 +820,9 @@ void MultiPathManipulator::_commit(CommitEvent cps) _selection.signal_update.emit(); invokeForAll(&PathManipulator::writeXML); if (key) { - DocumentUndo::maybeDone(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::maybeDone(_desktop->getDocument(), key, SP_VERB_CONTEXT_NODE, reason); } else { - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, reason); } signal_coords_changed.emit(); } @@ -831,7 +831,7 @@ void MultiPathManipulator::_commit(CommitEvent cps) void MultiPathManipulator::_done(gchar const *reason, bool alert_LPE) { invokeForAll(&PathManipulator::update, alert_LPE); invokeForAll(&PathManipulator::writeXML); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, reason); signal_coords_changed.emit(); } diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 8c22f7c6e..eeea47e4d 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -17,7 +17,7 @@ #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "desktop.h" -#include "desktop-handles.h" + #include "preferences.h" #include "snap.h" #include "snap-preferences.h" diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 8b99c33b8..c8b986824 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -23,7 +23,7 @@ #include <glibmm/i18n.h> #include "ui/tool/path-manipulator.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "display/curve.h" @@ -972,6 +972,10 @@ NodeList::iterator PathManipulator::subdivideSegment(NodeList::iterator first, d NodeList &list = NodeList::get(first); NodeList::iterator second = first.next(); if (!second) throw std::invalid_argument("Subdivide after last node in open path"); + if (first->type() == NODE_SYMMETRIC) + first->setType(NODE_SMOOTH, false); + if (second->type() == NODE_SYMMETRIC) + second->setType(NODE_SMOOTH, false); // We need to insert the segment after 'first'. We can't simply use 'second' // as the point of insertion, because when 'first' is the last node of closed path, @@ -1617,13 +1621,13 @@ void PathManipulator::_removeNodesFromSelection() void PathManipulator::_commit(Glib::ustring const &annotation) { writeXML(); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data()); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, annotation.data()); } void PathManipulator::_commit(Glib::ustring const &annotation, gchar const *key) { writeXML(); - DocumentUndo::maybeDone(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, + DocumentUndo::maybeDone(_desktop->getDocument(), key, SP_VERB_CONTEXT_NODE, annotation.data()); } diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index bdeacadc9..e4e701785 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -11,7 +11,7 @@ #include "control-point.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/sodipodi-ctrlrect.h" #include "ui/tools/tool-base.h" #include "preferences.h" @@ -37,7 +37,7 @@ public: _cancel(false) { setVisible(false); - _rubber = static_cast<CtrlRect*>(sp_canvas_item_new(sp_desktop_controls(_desktop), + _rubber = static_cast<CtrlRect*>(sp_canvas_item_new(_desktop->getControls(), SP_TYPE_CTRLRECT, NULL)); sp_canvas_item_hide(_rubber); } @@ -100,7 +100,7 @@ private: Selector::Selector(SPDesktop *d) : Manipulator(d) - , _dragger(new SelectorPoint(d, sp_desktop_controls(d), this)) + , _dragger(new SelectorPoint(d, d->getControls(), this)) { _dragger->setVisible(false); } diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 7d5c9bf0c..da2a54989 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -15,7 +15,7 @@ #include <glib/gi18n.h> #include <2geom/transforms.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/sodipodi-ctrlrect.h" #include "preferences.h" #include "snap.h" @@ -686,7 +686,7 @@ TransformHandleSet::TransformHandleSet(SPDesktop *d, SPCanvasGroup *th_group) , _in_transform(false) , _visible(true) { - _trans_outline = static_cast<CtrlRect*>(sp_canvas_item_new(sp_desktop_controls(_desktop), + _trans_outline = static_cast<CtrlRect*>(sp_canvas_item_new(_desktop->getControls(), SP_TYPE_CTRLRECT, NULL)); sp_canvas_item_hide(_trans_outline); _trans_outline->setDashed(true); |
