summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-03-08 22:38:25 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-03-08 22:38:25 +0000
commit02da52f4583c25d4b99dae65ec98fa06814fe2cf (patch)
tree85c7ec81716140d70385bcf4c1910797723fce45 /src
parentmake sure undoing center moves emits modified signal and is thus noticed by t... (diff)
downloadinkscape-02da52f4583c25d4b99dae65ec98fa06814fe2cf.tar.gz
inkscape-02da52f4583c25d4b99dae65ec98fa06814fe2cf.zip
when dragging center, defer repr updating and committing until ungrab; this makes dragging faster. also remove superfluous reffing of objects while dragging
(bzr r2578)
Diffstat (limited to 'src')
-rw-r--r--src/seltrans.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 42a46adb2..65b834a12 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -220,12 +220,10 @@ void Inkscape::SelTrans::setCenter(NR::Point const &p)
// Write the new center position into all selected items
for (GSList const *l = _desktop->selection->itemList(); l; l = l->next) {
- SPItem *it = (SPItem*)sp_object_ref(SP_OBJECT(l->data), NULL);
+ SPItem *it = (SPItem*)SP_OBJECT(l->data);
it->setCenter(p);
- SP_OBJECT(it)->updateRepr();
+ // only set the value; updating repr and document_done will be done once, on ungrab
}
- sp_document_maybe_done (sp_desktop_document(_desktop), "center::move", SP_VERB_CONTEXT_SELECT,
- _("Set center"));
_updateHandles();
}
@@ -387,6 +385,17 @@ void Inkscape::SelTrans::ungrab()
}
} else {
+
+ if (_center_is_set) {
+ // we were dragging center; update reprs and commit undoable action
+ for (GSList const *l = _desktop->selection->itemList(); l; l = l->next) {
+ SPItem *it = (SPItem*)SP_OBJECT(l->data);
+ SP_OBJECT(it)->updateRepr();
+ }
+ sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+ _("Set center"));
+ }
+
_items.clear();
_items_centers.clear();
_updateHandles();
@@ -634,13 +643,13 @@ void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle
if (state & GDK_SHIFT_MASK) {
// Unset the center position for all selected items
for (GSList const *l = _desktop->selection->itemList(); l; l = l->next) {
- SPItem *it = (SPItem*)sp_object_ref(SP_OBJECT(l->data), NULL);
+ SPItem *it = (SPItem*)(SP_OBJECT(l->data));
it->unsetCenter();
SP_OBJECT(it)->updateRepr();
_center_is_set = false; // center has changed
_updateHandles();
}
- sp_document_maybe_done (sp_desktop_document(_desktop), "center::unset", SP_VERB_CONTEXT_SELECT,
+ sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
_("Reset center"));
}
break;