index e4bd0141461cf6e4158d89e405c50f35a5631beb..b8f313948e222fc3931c69f79cc3f01eeb69063d 100644 (file)
#include <gtkmm/box.h>
#include <gtkmm.h>
-#include "display/sp-canvas.h"
+#include "sp-canvas-item.h"
#include "xml/repr.h"
#include "ui/widget/color-picker.h"
#include "ui/widget/scalar-unit.h"
struct SPDesktop;
struct SPNamedView;
+struct SPCanvasBuf;
class SPDocument;
namespace Inkscape {
Geom::Point spacing; /**< Spacing between elements of the grid */
bool scaled[2]; /**< Whether the grid is in scaled mode, which can
- be different in the X or Y direction, hense two
+ be different in the X or Y direction, hence two
variables */
Geom::Point ow; /**< Transformed origin by the affine for the zoom */
Geom::Point sw; /**< Transformed spacing by the affine for the zoom */
CanvasXYGridSnapper(CanvasXYGrid *grid, SnapManager *sm, Geom::Coord const d);
bool ThisSnapperMightSnap() const;
+ Geom::Coord getSnapperTolerance() const; //returns the tolerance of the snapper in screen pixels (i.e. independent of zoom)
+ bool getSnapperAlwaysSnap() const; //if true, then the snapper will always snap, regardless of its tolerance
+
private:
LineList _getSnapLines(Geom::Point const &p) const;
- void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, const Geom::Point point_on_line) const;
+ void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, Geom::Point const normal_to_line, const Geom::Point point_on_line) const;
+ void _addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const;
CanvasXYGrid *grid;
};