Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Inkscape::SnappedPoint SnapManager::constrainedSnapTranslation ( std::vector< Inkscape::SnapCandidatePoint > 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.

Parameters:
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.
Returns:
An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.

Definition at line 763 of file snap.cpp.

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

{
    if (p.size() == 1) {
        Geom::Point pt = _transformPoint(p.at(0), TRANSLATION, tr, Geom::Point(0,0), Geom::X, false);
        _displaySnapsource(Inkscape::SnapCandidatePoint(pt, p.at(0).getSourceType()));
    }

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


Generated by  Doxygen 1.6.0   Back to index