Logo Search packages:      
Sourcecode: inkscape version File versions

Inkscape::SnappedPoint SnapManager::constrainedSnapTranslation ( Inkscape::SnapPreferences::PointType  point_type,
std::vector< std::pair< Geom::Point, int > > const &  p,
Geom::Point const &  pointer,
Inkscape::Snapper::ConstraintLine const &  constraint,
Geom::Point const &  tr 
) const

Apply a translation to a set of points and try to snap along a constraint.

point_type Category of points to which the source point belongs: node or bounding box.
p Collection of points to snap (snap sources), at their untransformed position, all points undergoing the same transformation. Paired with an identifier of the type of the snap source.
pointer Location of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
constraint The direction or line along which snapping must occur.
tr Proposed translation; the final translation can only be calculated after snapping has occurred.
An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.

Definition at line 788 of file snap.cpp.

References _displaySnapsource(), _snapTransformed(), and _transformPoint().

    if (p.size() == 1) {
        _displaySnapsource(point_type, std::make_pair(_transformPoint(p.at(0), TRANSLATION, tr, Geom::Point(0,0), Geom::X, false), (p.at(0)).second));

    return _snapTransformed(point_type, p, pointer, true, constraint, TRANSLATION, tr, Geom::Point(0,0), Geom::X, false);

Generated by  Doxygen 1.6.0   Back to index