summaryrefslogtreecommitdiffstats
path: root/src/guide-snapper.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/guide-snapper.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/guide-snapper.h b/src/guide-snapper.h
new file mode 100644
index 0000000..94863fa
--- /dev/null
+++ b/src/guide-snapper.h
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+#ifndef SEEN_GUIDE_SNAPPER_H
+#define SEEN_GUIDE_SNAPPER_H
+/*
+ * Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * Frank Felfe <innerspace@iname.com>
+ * Carl Hetherington <inkscape@carlh.net>
+ *
+ * Copyright (C) 1999-2002 Authors
+ *
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#include "line-snapper.h"
+
+class SPNamedView;
+
+namespace Inkscape
+{
+
+/**
+ * Snap to guides.
+ */
+class GuideSnapper : public LineSnapper
+{
+public:
+ GuideSnapper(SnapManager *sm, Geom::Coord const d);
+ bool ThisSnapperMightSnap() const override;
+
+ Geom::Coord getSnapperTolerance() const override; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom)
+ bool getSnapperAlwaysSnap() const override; //if true, then the snapper will always snap, regardless of its tolerance
+
+private:
+ LineList _getSnapLines(Geom::Point const &p) const override;
+ void _addSnappedLine(IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, Geom::Point const &normal_to_line, Geom::Point const &point_on_line) const override;
+ void _addSnappedLinesOrigin(IntermSnapResults &isr, Geom::Point const &origin, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
+ void _addSnappedLinePerpendicularly(IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
+ void _addSnappedPoint(IntermSnapResults &isr, Geom::Point const &snapped_point, Geom::Coord const &snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const override;
+};
+
+}
+
+#endif
+
+
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :