diff --git a/src/snapper.h b/src/snapper.h
index 0110a9154a92d399d2f8c689e96c594373ed49c3..110b3d36ad5292fa721e1db7e55b76af01c5ce19 100644 (file)
--- a/src/snapper.h
+++ b/src/snapper.h
*/
virtual bool ThisSnapperMightSnap() const {return _snap_enabled;} // will likely be overridden by derived classes
- void setEnabled(bool s); // This is only used for grids, for which snapping can be enabled individually
+ // These four methods are only used for grids, for which snapping can be enabled individually
+ void setEnabled(bool s);
+ void setSnapVisibleOnly(bool s);
bool getEnabled() const {return _snap_enabled;}
+ bool getSnapVisibleOnly() const {return _snap_visible_only;}
virtual void freeSnap(SnappedConstraints &/*sc*/,
SnapPreferences::PointType const &/*t*/,
_has_point = true;
}
+ Geom::Point projection(Geom::Point const &p) const { // returns the projection of p on this constraintline
+ Geom::Point const p1_on_cl = _has_point ? _point : p;
+ Geom::Point const p2_on_cl = p1_on_cl + _direction;
+ return Geom::projection(p, Geom::Line(p1_on_cl, p2_on_cl));
+ }
+
private:
bool _has_point;
protected:
SnapManager *_snapmanager;
+ // This is only used for grids, for which snapping can be enabled individually
bool _snap_enabled; ///< true if this snapper is enabled, otherwise false
- // This is only used for grids, for which snapping can be enabled individually
+ bool _snap_visible_only;
};
}