summaryrefslogtreecommitdiffstats
path: root/src/display/snap-indicator.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-02-25 21:54:44 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-02-25 21:54:44 +0000
commit6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89 (patch)
tree9e88824107418e33478f6143ca44b95f607e84d3 /src/display/snap-indicator.cpp
parentfix warnings (diff)
downloadinkscape-6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89.tar.gz
inkscape-6edc17e9611bfc1875cf3fdbaf8fb1ce3c820b89.zip
1) Fix moving by an integer multiple of the grid spacing (<alt>-dragging in the selector tool)
2) Allow constrained translation for 1) (with <ctrl>) 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)
Diffstat (limited to 'src/display/snap-indicator.cpp')
-rw-r--r--src/display/snap-indicator.cpp10
1 files changed, 9 insertions, 1 deletions
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);