summaryrefslogtreecommitdiffstats
path: root/src/text-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-01-25 13:35:08 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-01-25 13:35:08 +0000
commit3b35e676c9107f8627587365f6e01ebf0093e9c5 (patch)
tree8e5d306024820cf9b2adf2e5b4d4735959c8803e /src/text-context.cpp
parentremoving void files (diff)
downloadinkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.tar.gz
inkscape-3b35e676c9107f8627587365f6e01ebf0093e9c5.zip
- The snap-delay mechanism should now be more robust. From now on, it must be turned on and off explicitely within each context. This prevents delayed snapping events from being fired after the context or context's state has changed.
- Creating single dots now snaps (bzr r7172)
Diffstat (limited to 'src/text-context.cpp')
-rw-r--r--src/text-context.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/text-context.cpp b/src/text-context.cpp
index ad9211cba..6e4b637b8 100644
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
@@ -353,6 +353,7 @@ sp_text_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
tc->dragging = 1;
+ sp_canvas_set_snap_delay_active(desktop->canvas, true);
}
ret = TRUE;
}
@@ -369,6 +370,7 @@ sp_text_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
tc->dragging = 2;
+ sp_canvas_set_snap_delay_active(desktop->canvas, true);
ret = TRUE;
}
}
@@ -380,12 +382,14 @@ sp_text_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
tc->dragging = 3;
+ sp_canvas_set_snap_delay_active(desktop->canvas, true);
ret = TRUE;
}
break;
case GDK_BUTTON_RELEASE:
if (event->button.button == 1 && tc->dragging && !event_context->space_panning) {
tc->dragging = 0;
+ sp_canvas_set_snap_delay_active(desktop->canvas, false);
ret = TRUE;
}
break;
@@ -1011,7 +1015,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
sp_document_maybe_done(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
_("Kern to the left"));
} else {
- if (MOD__CTRL)
+ if (MOD__CTRL)
tc->text_sel_end.cursorLeftWithControl();
else
tc->text_sel_end.cursorLeft();
@@ -1314,7 +1318,7 @@ sp_text_paste_inline(SPEventContext *ec)
Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
Glib::ustring const clip_text = refClipboard->wait_for_text();
-
+
if (!clip_text.empty()) {
// Fix for 244940
// The XML standard defines the following as valid characters
@@ -1342,7 +1346,7 @@ sp_text_paste_inline(SPEventContext *ec)
itr = text.erase(itr);
}
}
-
+
if (!tc->text) { // create text if none (i.e. if nascent_object)
sp_text_context_setup_text(tc);
tc->nascent_object = 0; // we don't need it anymore, having created a real <text>
@@ -1430,7 +1434,7 @@ sp_text_context_selection_changed(Inkscape::Selection *selection, SPTextContext
SPEventContext *ec = SP_EVENT_CONTEXT(tc);
ec->shape_editor->unset_item(SH_KNOTHOLDER);
- SPItem *item = selection->singleItem();
+ SPItem *item = selection->singleItem();
if (item && SP_IS_FLOWTEXT (item) && SP_FLOWTEXT(item)->has_internal_frame()) {
ec->shape_editor->set_item(item, SH_KNOTHOLDER);
}