summaryrefslogtreecommitdiffstats
path: root/src/ui/tool
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-31 19:31:21 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-31 19:31:21 +0000
commitbb4d4442a7ec92e15c976689756aa9566cd2430e (patch)
tree789234d2e031ad42cbf6cc3176cdfb49f811421c /src/ui/tool
parentAdjust devlibs copied to dist directory in Windows build (diff)
downloadinkscape-bb4d4442a7ec92e15c976689756aa9566cd2430e.tar.gz
inkscape-bb4d4442a7ec92e15c976689756aa9566cd2430e.zip
Add pref settings that control updating the display of paths when dragging
or transforming nodes them. Fixed bugs: - https://launchpad.net/bugs/380762 (bzr r9038)
Diffstat (limited to 'src/ui/tool')
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp22
-rw-r--r--src/ui/tool/multi-path-manipulator.h4
-rw-r--r--src/ui/tool/node-tool.cpp8
-rw-r--r--src/ui/tool/node-tool.h2
-rw-r--r--src/ui/tool/path-manipulator.cpp26
-rw-r--r--src/ui/tool/path-manipulator.h4
6 files changed, 64 insertions, 2 deletions
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index d1138abd5..734ddf15b 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -174,6 +174,8 @@ void MultiPathManipulator::setItems(std::set<ShapeRecord> const &s)
// always show outlines for clips and masks
newpm->showOutline(_show_outline || r.role != SHAPE_ROLE_NORMAL);
newpm->showPathDirection(_show_path_direction);
+ newpm->setLiveOutline(_live_outline);
+ newpm->setLiveObjects(_live_objects);
_mmap.insert(std::make_pair(r, newpm));
}
}
@@ -394,6 +396,26 @@ void MultiPathManipulator::showPathDirection(bool show)
_show_path_direction = show;
}
+/** @brief Set live outline update status
+ * When set to true, outline will be updated continuously when dragging
+ * or transforming nodes. Otherwise it will only update when changes are committed
+ * to XML. */
+void MultiPathManipulator::setLiveOutline(bool set)
+{
+ invokeForAll(&PathManipulator::setLiveOutline, set);
+ _live_outline = set;
+}
+
+/** @brief Set live object update status
+ * When set to true, objects will be updated continuously when dragging
+ * or transforming nodes. Otherwise they will only update when changes are committed
+ * to XML. */
+void MultiPathManipulator::setLiveObjects(bool set)
+{
+ invokeForAll(&PathManipulator::setLiveObjects, set);
+ _live_objects = set;
+}
+
void MultiPathManipulator::updateOutlineColors()
{
//for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h
index 151e153ec..121818f97 100644
--- a/src/ui/tool/multi-path-manipulator.h
+++ b/src/ui/tool/multi-path-manipulator.h
@@ -65,6 +65,8 @@ public:
void showOutline(bool show);
void showHandles(bool show);
void showPathDirection(bool show);
+ void setLiveOutline(bool set);
+ void setLiveObjects(bool set);
void updateOutlineColors();
sigc::signal<void> signal_coords_changed; /// Emitted whenever the coordinates
@@ -111,6 +113,8 @@ private:
bool _show_handles;
bool _show_outline;
bool _show_path_direction;
+ bool _live_outline;
+ bool _live_objects;
friend class PathManipulator;
};
diff --git a/src/ui/tool/node-tool.cpp b/src/ui/tool/node-tool.cpp
index 08d893855..0c4599e52 100644
--- a/src/ui/tool/node-tool.cpp
+++ b/src/ui/tool/node-tool.cpp
@@ -286,6 +286,8 @@ void ink_node_tool_setup(SPEventContext *ec)
// read prefs before adding items to selection to prevent momentarily showing the outline
sp_event_context_read(nt, "show_handles");
sp_event_context_read(nt, "show_outline");
+ sp_event_context_read(nt, "live_outline");
+ sp_event_context_read(nt, "live_objects");
sp_event_context_read(nt, "show_path_direction");
sp_event_context_read(nt, "show_transform_handles");
sp_event_context_read(nt, "single_node_transform_handles");
@@ -316,6 +318,12 @@ void ink_node_tool_set(SPEventContext *ec, Inkscape::Preferences::Entry *value)
} else if (entry_name == "show_outline") {
nt->show_outline = value->getBool();
nt->_multipath->showOutline(nt->show_outline);
+ } else if (entry_name == "live_outline") {
+ nt->live_outline = value->getBool();
+ nt->_multipath->setLiveOutline(nt->live_outline);
+ } else if (entry_name == "live_objects") {
+ nt->live_objects = value->getBool();
+ nt->_multipath->setLiveObjects(nt->live_objects);
} else if (entry_name == "show_path_direction") {
nt->show_path_direction = value->getBool();
nt->_multipath->showPathDirection(nt->show_path_direction);
diff --git a/src/ui/tool/node-tool.h b/src/ui/tool/node-tool.h
index 65b16ff72..130e16198 100644
--- a/src/ui/tool/node-tool.h
+++ b/src/ui/tool/node-tool.h
@@ -58,6 +58,8 @@ struct InkNodeTool : public SPEventContext
unsigned cursor_drag : 1;
unsigned show_outline : 1;
+ unsigned live_outline : 1;
+ unsigned live_objects : 1;
unsigned show_path_direction : 1;
unsigned show_transform_handles : 1;
unsigned single_node_transform_handles : 1;
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 2d4df86f3..0ce02aa95 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -98,6 +98,9 @@ PathManipulator::PathManipulator(MultiPathManipulator &mpm, SPPath *path,
, _num_selected(0)
, _show_handles(true)
, _show_outline(false)
+ , _show_path_direction(false)
+ , _live_outline(true)
+ , _live_objects(true)
, _lpe_key(lpe_key)
{
if (_lpe_key.empty()) {
@@ -190,6 +193,13 @@ void PathManipulator::writeXML()
_path = 0;
}
_observer->unblock();
+
+ if (!empty()) {
+ if (!_live_outline)
+ _updateOutline();
+ if (!_live_objects)
+ _setGeometry();
+ }
}
/** Remove all nodes from the path. */
@@ -754,6 +764,16 @@ void PathManipulator::showPathDirection(bool show)
_updateOutline();
}
+void PathManipulator::setLiveOutline(bool set)
+{
+ _live_outline = set;
+}
+
+void PathManipulator::setLiveObjects(bool set)
+{
+ _live_objects = set;
+}
+
void PathManipulator::setControlsTransform(Geom::Matrix const &tnew)
{
Geom::Matrix delta = _i2d_transform.inverse() * _edit_transform.inverse() * tnew * _i2d_transform;
@@ -1016,8 +1036,10 @@ void PathManipulator::_createGeometryFromControlPoints()
}
builder.finish();
_spcurve->set_pathvector(builder.peek() * (_edit_transform * _i2d_transform).inverse());
- _updateOutline();
- _setGeometry();
+ if (_live_outline)
+ _updateOutline();
+ if (_live_objects)
+ _setGeometry();
}
/** Build one segment of the geometric representation.
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 4c7313a5f..6b69e226a 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -79,6 +79,8 @@ public:
void showOutline(bool show);
void showHandles(bool show);
void showPathDirection(bool show);
+ void setLiveOutline(bool set);
+ void setLiveObjects(bool set);
void setControlsTransform(Geom::Matrix const &);
void hideDragPoint();
@@ -130,6 +132,8 @@ private:
bool _show_handles;
bool _show_outline;
bool _show_path_direction;
+ bool _live_outline;
+ bool _live_objects;
Glib::ustring _lpe_key;
friend class PathManipulatorObserver;