From 6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 25 Feb 2010 22:54:44 +0100 Subject: 1) Fix moving by an integer multiple of the grid spacing (-dragging in the selector tool) 2) Allow constrained translation for 1) (with ) 3) Fix snapping to the grid when pasting 4) Show snap indicators for all of the above 5) Implement snap delay mechanism for 1) and 2) (bzr r9113) --- src/display/snap-indicator.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/display/snap-indicator.cpp') diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index 25b5090c1..1e4ca12a8 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -208,6 +208,9 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap case SNAPSOURCE_TEXT_BASELINE: source_name = _("Text baseline"); break; + case SNAPSOURCE_GRID_PITCH: + source_name = _("Multiple of grid spacing"); + break; default: g_warning("Snap source has not yet been defined!"); break; @@ -247,7 +250,12 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap _snaptarget_is_presnap = pre_snap; // Display the tooltip, which reveals the type of snap source and the type of snap target - gchar *tooltip_str = g_strconcat(source_name, _(" to "), target_name, NULL); + gchar *tooltip_str = NULL; + if (p.getSource() != SNAPSOURCE_GRID_PITCH) { + tooltip_str = g_strconcat(source_name, _(" to "), target_name, NULL); + } else { + tooltip_str = g_strdup(source_name); + } Geom::Point tooltip_pos = p.getPoint() + _desktop->w2d(Geom::Point(15, -15)); SPCanvasItem *canvas_tooltip = sp_canvastext_new(sp_desktop_tempgroup(_desktop), _desktop, tooltip_pos, tooltip_str); -- cgit v1.2.3