summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d55f93)
raw | patch | inline | side by side (parent: 1d55f93)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 27 Jul 2008 15:46:58 +0000 (15:46 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 27 Jul 2008 15:46:58 +0000 (15:46 +0000) |
src/knot-holder-entity.cpp | patch | blob | history | |
src/knot-holder-entity.h | patch | blob | history | |
src/knotholder.cpp | patch | blob | history |
index e2ae5f10e663e3084070fe37e737b760934d5df5..20ab011434c7e4792f331ceb5819c6f4db96af51 100644 (file)
KnotHolderEntity::~KnotHolderEntity()
{
+ _moved_connection.disconnect();
+ _click_connection.disconnect();
+ _ungrabbed_connection.disconnect();
+
/* unref should call destroy */
if (knot) {
g_object_unref(knot);
index e4564cd01e276d3b6360a89ceffafda4a606b7ff..a29b71f4d8a722a0a73c06593627f21e24690aa6 100644 (file)
--- a/src/knot-holder-entity.h
+++ b/src/knot-holder-entity.h
virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state) = 0;
virtual NR::Point knot_get() = 0;
virtual void knot_click(guint /*state*/) {}
- virtual void onKnotUngrabbed() {}
void update_knot();
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index f0495a244d8c8012db34b275556623357770aaab..f2bbbfbc06803e4932137d3f6d8c4b97d82cd1c1 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
this->released(this->item);
} else {
SPObject *object = (SPObject *) this->item;
+
+ // Caution: this call involves a screen update, which may process events, and as a
+ // result the knotholder may be destructed. So, after the updateRepr, we cannot use any
+ // fields of this knotholder (such as this->item), but only values we have saved beforehand
+ // (such as object).
object->updateRepr();
/* do cleanup tasks (e.g., for LPE items write the parameter values
* that were changed by dragging the handle to SVG)
*/
- if (SP_IS_LPE_ITEM(item)) {
- // This writes all parameters to SVG. Is this sufficiently efficient or should we only write
- // the ones that were changed (e.g., via the individual handles' onKnotUngrabbed() method?
- Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item));
+ if (SP_IS_LPE_ITEM(object)) {
+ // This writes all parameters to SVG. Is this sufficiently efficient or should we only
+ // write the ones that were changed?
+
+ Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(object));
if (lpe) {
LivePathEffectObject *lpeobj = lpe->getLPEObj();
SP_OBJECT(lpeobj)->updateRepr();
}
}
- // this was once used to write individual parameter values to SVG but this is now done globally above;
- // we leave the calls to onKnotUngrabbed, anyway, in case any other cleanup tasks need to be done
- for(std::list<KnotHolderEntity *>::iterator i = this->entity.begin(); i != this->entity.end(); ++i) {
- KnotHolderEntity *e = *i;
- if (e->knot == knot) {
- e->onKnotUngrabbed(); // for most KnotHolderEntitys this does nothing
- }
- }
unsigned int object_verb = SP_VERB_NONE;