Logo Search packages:      
Sourcecode: inkscape version File versions

Inkscape::SnappedPoint SnapManager::freeSnapScale ( Inkscape::SnapPreferences::PointType  point_type,
std::vector< std::pair< Geom::Point, int > > const &  p,
Geom::Point const &  pointer,
Geom::Scale const &  s,
Geom::Point const &  o 
) const

Apply a scaling to a set of points and try to snap freely in 2 degrees-of-freedom.

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).
s Proposed scaling; the final scaling can only be calculated after snapping has occurred
o Origin of the scaling
An instance of the SnappedPoint class, which holds data on the snap source, snap target, and various metrics.

Definition at line 813 of file snap.cpp.

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

    if (p.size() == 1) {
        _displaySnapsource(point_type, std::make_pair(_transformPoint(p.at(0), SCALE, Geom::Point(s[Geom::X], s[Geom::Y]), o, Geom::X, false), (p.at(0)).second));

    return _snapTransformed(point_type, p, pointer, false, Geom::Point(0,0), SCALE, Geom::Point(s[Geom::X], s[Geom::Y]), o, Geom::X, false);

Generated by  Doxygen 1.6.0   Back to index