summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-09-03 05:16:56 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-09-03 05:16:56 +0000
commit32ce386c5f77e12b68bc86ddbe54086bb524636f (patch)
treefe1774326b75492f3046ec0a64ebd912237d47c6 /src
parentfix pattern transform when doing object-to-pattern within a transformed group (diff)
downloadinkscape-32ce386c5f77e12b68bc86ddbe54086bb524636f.tar.gz
inkscape-32ce386c5f77e12b68bc86ddbe54086bb524636f.zip
again rearrange code in ungrab handler so that screen update is as close to the end as possible, to prevent crash when switching tools during redraw after transform
(bzr r1667)
Diffstat (limited to 'src')
-rw-r--r--src/seltrans.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 675cb672e..b9c8d8bf0 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -101,6 +101,7 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) :
}
_updateVolatileState();
+ _current.set_identity();
_center_is_set = false; // reread _center from items, or set to bbox midpoint
@@ -238,6 +239,7 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho
_grabbed = true;
_show_handles = show_handles;
_updateVolatileState();
+ _current.set_identity();
_changed = false;
@@ -325,6 +327,29 @@ void Inkscape::SelTrans::ungrab()
_show_handles = true;
Inkscape::Selection *selection = sp_desktop_selection(_desktop);
+ _updateVolatileState();
+
+ for (unsigned i = 0; i < _items.size(); i++) {
+ sp_object_unref(SP_OBJECT(_items[i].first), NULL);
+ }
+ _items.clear();
+ _items_centers.clear();
+
+ sp_canvas_item_hide(_norm);
+ sp_canvas_item_hide(_grip);
+
+ if (_show == SHOW_OUTLINE) {
+ for (int i = 0; i < 4; i++)
+ sp_canvas_item_hide(_l[i]);
+ }
+
+ if (_stamp_cache) {
+ g_slist_free(_stamp_cache);
+ _stamp_cache = NULL;
+ }
+
+ _message_context.clear();
+
bool updh = true;
if (!_empty && _changed) {
sp_selection_apply_affine(selection, _current, (_show == SHOW_OUTLINE)? true : false);
@@ -361,30 +386,9 @@ void Inkscape::SelTrans::ungrab()
updh = false;
}
- for (unsigned i = 0; i < _items.size(); i++) {
- sp_object_unref(SP_OBJECT(_items[i].first), NULL);
- }
- _items.clear();
- _items_centers.clear();
-
- sp_canvas_item_hide(_norm);
- sp_canvas_item_hide(_grip);
-
- if (_show == SHOW_OUTLINE) {
- for (int i = 0; i < 4; i++)
- sp_canvas_item_hide(_l[i]);
- }
-
- _updateVolatileState();
if (updh) {
_updateHandles();
}
- if (_stamp_cache) {
- g_slist_free(_stamp_cache);
- _stamp_cache = NULL;
- }
-
- _message_context.clear();
}
/* fixme: This is really bad, as we compare positions for each stamp (Lauris) */
@@ -538,8 +542,6 @@ void Inkscape::SelTrans::_updateVolatileState()
}
_strokewidth = stroke_average_width (selection->itemList());
-
- _current.set_identity();
}
static void sp_remove_handles(SPKnot *knot[], gint num)
@@ -721,6 +723,7 @@ void Inkscape::SelTrans::_selChanged(Inkscape::Selection *selection)
{
if (!_grabbed) {
_updateVolatileState();
+ _current.set_identity();
_center_is_set = false; // center(s) may have changed
_updateHandles();
}
@@ -730,6 +733,7 @@ void Inkscape::SelTrans::_selModified(Inkscape::Selection *selection, guint flag
{
if (!_grabbed) {
_updateVolatileState();
+ _current.set_identity();
// reset internal flag
_changed = false;