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

Inkscape::SnappedPoint SnapManager::constrainedSnapScale ( std::vector< Inkscape::SnapCandidatePoint > const &  p,
Geom::Point const &  pointer,
Geom::Scale const &  s,
Geom::Point const &  o 
) const

Apply a scaling to a set of points and snap such that the aspect ratio of the selection is preserved.

point_typeCategory of points to which the source point belongs: node or bounding box.
pCollection 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.
pointerLocation of the mouse pointer at the time dragging started (i.e. when the selection was still untransformed).
sProposed scaling; the final scaling can only be calculated after snapping has occurred
oOrigin 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().

    // When constrained scaling, only uniform scaling is supported.
    if (p.size() == 1) {
        Geom::Point pt = _transformPoint(p.at(0), SCALE, Geom::Point(s[Geom::X], s[Geom::Y]), o, Geom::X, true);
        _displaySnapsource(Inkscape::SnapCandidatePoint(pt, p.at(0).getSourceType()));

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

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index