summaryrefslogtreecommitdiffstats
path: root/src/display/snap-indicator.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2011-10-08 20:00:37 +0000
committerDiederik van Lierop <mail@diedenrezi.nl>2011-10-08 20:00:37 +0000
commitf4c59e50df9090a1a4801da06f9a0021b67ce7a2 (patch)
tree825ce1a6b013c238a89f06c2fdf74cee0861e02b /src/display/snap-indicator.cpp
parentDoc. Keys and mouse reference update. (diff)
downloadinkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.tar.gz
inkscape-f4c59e50df9090a1a4801da06f9a0021b67ce7a2.zip
1) make snapping to clip/mask paths optional (see document properties dialog -> snap tab)
2) for debugging purposes: code added for showing all snap candidates 3) groundwork for tangential/perpendicular snapping (bzr r10672)
Diffstat (limited to 'src/display/snap-indicator.cpp')
-rw-r--r--src/display/snap-indicator.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp
index 0f31a24b9..72fdfbee7 100644
--- a/src/display/snap-indicator.cpp
+++ b/src/display/snap-indicator.cpp
@@ -105,6 +105,12 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap
case SNAPTARGET_PATH_GUIDE_INTERSECTION:
target_name = _("guide-path intersection");
break;
+ case SNAPTARGET_PATH_CLIP:
+ target_name = _("clip-path");
+ break;
+ case SNAPTARGET_PATH_MASK:
+ target_name = _("mask-path");
+ break;
case SNAPTARGET_BBOX_CORNER:
target_name = _("bounding box corner");
break;
@@ -326,6 +332,25 @@ SnapIndicator::set_new_snapsource(Inkscape::SnapCandidatePoint const &p)
}
void
+SnapIndicator::set_new_debugging_point(Geom::Point const &p)
+{
+ g_assert(_desktop != NULL);
+ SPCanvasItem * canvasitem = sp_canvas_item_new( sp_desktop_tempgroup (_desktop),
+ SP_TYPE_CTRL,
+ "anchor", GTK_ANCHOR_CENTER,
+ "size", 10.0,
+ "fill_color", 0x00ff00ff,
+ "stroked", FALSE,
+ "mode", SP_KNOT_MODE_XOR,
+ "shape", SP_KNOT_SHAPE_DIAMOND,
+ NULL );
+
+ SP_CTRL(canvasitem)->moveto(p);
+ _debugging_points.push_back(_desktop->add_temporary_canvasitem(canvasitem, 5000));
+
+}
+
+void
SnapIndicator::remove_snapsource()
{
if (_snapsource) {
@@ -334,6 +359,16 @@ SnapIndicator::remove_snapsource()
}
}
+void
+SnapIndicator::remove_debugging_points()
+{
+ for (std::list<TemporaryItem *>::const_iterator i = _debugging_points.begin(); i != _debugging_points.end(); i++) {
+ _desktop->remove_temporary_canvasitem(*i);
+ }
+ _debugging_points.clear();
+}
+
+
} //namespace Display
} /* namespace Inkscape */