summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c874d2e)
raw | patch | inline | side by side (parent: c874d2e)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:56:10 +0000 (14:56 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:56:10 +0000 (14:56 +0000) |
diff --git a/src/node-context.cpp b/src/node-context.cpp
index 66e535ac3100c795144d8b8e2e192f5d179a3d3a..bff972408c8910055f80c846d4f99f5c3489141b 100644 (file)
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
nc->sel_changed_connection.disconnect();
nc->sel_changed_connection.~connection();
- // TODO: should this be here?
- SPItem *item = sp_desktop_selection(ec->desktop)->singleItem();
- if (item && SP_IS_LPE_ITEM(item)) {
- sp_lpe_item_remove_temporary_canvasitems(SP_LPE_ITEM(item), ec->desktop);
- }
-
delete nc->shape_editor;
if (nc->_node_message_context) {
diff --git a/src/selection.cpp b/src/selection.cpp
index 33be17a8ef19528943e33b6b7ec8bf92d2da0373..acab9396c86bb29b758a951e8b06d9dfb888373f 100644 (file)
--- a/src/selection.cpp
+++ b/src/selection.cpp
add_3D_boxes_recursively(obj);
- if (SP_IS_LPE_ITEM(obj)) {
- sp_lpe_item_add_temporary_canvasitems(SP_LPE_ITEM(obj), desktop());
- }
-
_release_connections[obj] = obj->connectRelease(sigc::mem_fun(*this, (void (Selection::*)(SPObject *))&Selection::remove));
_modified_connections[obj] = obj->connectModified(sigc::mem_fun(*this, &Selection::_schedule_modified));
}
remove_3D_boxes_recursively(obj);
- if (SP_IS_LPE_ITEM(obj)) {
- sp_lpe_item_remove_temporary_canvasitems(SP_LPE_ITEM(obj), desktop());
- }
-
_objs = g_slist_remove(_objs, obj);
}
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index 4c182788f3cb78c727e7ae9cfb1ec6e65da50cfd..c88b5eb3f453baa938ecc8ed6ea595fdfa8c9102 100644 (file)
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
switch(type) {
case SH_NODEPATH:
if (SP_IS_LPE_ITEM(item)) {
- //SPLPEItem *lpeitem = SP_LPE_ITEM(item);
- //Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem);
- //if (!(lpe && lpe->isVisible() && lpe->providesKnotholder())) {
- // only create nodepath if the item either doesn't have an LPE
- // or the LPE is invisible or it doesn't provide a knotholder itself
- this->nodepath = sp_nodepath_new(desktop, item,
- (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
- //} else if (lpe && lpe->isVisible()) {
- // sp_lpe_item_add_temporary_canvasitems(lpeitem, desktop);
- //}
+ this->nodepath = sp_nodepath_new(desktop, item, (prefs_get_int_attribute("tools.nodes", "show_handles", 1) != 0));
}
if (this->nodepath) {
this->nodepath->shape_editor = this;
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 4089e8a2445db45e8b87b8fa021f9b7ebf43d040..1138c3ccde7695a47707cab0380ac7cf30f29aeb 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
lpeitem->current_path_effect = NULL;
new (&lpeitem->lpe_modified_connection) sigc::connection();
-
- lpeitem->adding_helperpaths = false;
- lpeitem->removing_helperpaths = false;
}
static void
top = lpeitem;
}
- // TODO: ditch inkscape_active_desktop()
- SPDesktop *desktop = inkscape_active_desktop();
- if (desktop) {
- //sp_lpe_item_remove_temporary_canvasitems(lpeitem, desktop);
- //sp_lpe_item_add_temporary_canvasitems(lpeitem, desktop);
- }
-
if (SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect) {
SP_LPE_ITEM_CLASS (G_OBJECT_GET_CLASS (top))->update_patheffect (top, write);
}
return lpeitem->path_effects_enabled > 0;
}
-void
-sp_lpe_item_add_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop)
-{
- if (lpeitem->adding_helperpaths) {
- return;
- }
- lpeitem->adding_helperpaths = true;
- // FIXME: for some reason it seems that we must create the variable lpe AFTER checking
- // for adding_helperpaths == true; otherwise we get a crash on startup. why??
- Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem);
- if (lpe) {
- // TODO: can we just update the tempitem's SPCurve instead of recreating it each time?
- lpe->addHelperPaths(lpeitem, desktop);
- }
- lpeitem->adding_helperpaths = false;
-}
-
-void
-sp_lpe_item_remove_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop)
-{
- g_return_if_fail(lpeitem);
- g_return_if_fail(desktop);
-
- if (lpeitem->removing_helperpaths) {
- return;
- }
- lpeitem->removing_helperpaths = true;
-
- // destroy all temporary canvasitems created by LPEs
- std::vector<Inkscape::Display::TemporaryItem*>::iterator i;
- for (i = lpeitem->lpe_helperpaths.begin(); i != lpeitem->lpe_helperpaths.end(); ++i) {
- desktop->remove_temporary_canvasitem(*i);
- }
-
- lpeitem->removing_helperpaths = false;
-}
-
/*
Local Variables:
mode:c++
diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h
index c92616ccade3716657592892282e8c8f5f2df443..c5dc4048bce257806466457a090e4d1f8a1cc126 100644 (file)
--- a/src/sp-lpe-item.h
+++ b/src/sp-lpe-item.h
Inkscape::LivePathEffect::LPEObjectReference* current_path_effect;
std::vector<Inkscape::Display::TemporaryItem*> lpe_helperpaths;
- bool adding_helperpaths;
- bool removing_helperpaths;
-
sigc::connection lpe_modified_connection;
};
Inkscape::LivePathEffect::Effect* sp_lpe_item_get_current_lpe(SPLPEItem *lpeitem);
bool sp_lpe_item_set_current_path_effect(SPLPEItem *lpeitem, Inkscape::LivePathEffect::LPEObjectReference* lperef);
bool sp_lpe_item_path_effects_enabled(SPLPEItem *lpeitem);
-void sp_lpe_item_add_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop);
-void sp_lpe_item_remove_temporary_canvasitems(SPLPEItem *lpeitem, SPDesktop *desktop);
#endif /* !SP_LPE_ITEM_H_SEEN */