Logo Search packages:      
Sourcecode: inkscape version File versions

void SnapManager::setup ( SPDesktop const *  desktop,
bool  snapindicator = true,
SPItem const *  item_to_ignore = NULL,
std::vector< std::pair< Geom::Point, int > > *  unselected_nodes = NULL,
SPGuide *  guide_to_ignore = NULL 

Prepare the snap manager for the actual snapping, which includes building a list of snap targets to ignore and toggling the snap indicator.

There are two overloaded setup() methods, of which this one only allows for a single item to be ignored whereas the other one will take a list of items to ignore

desktop Reference to the desktop to which this snap manager is attached
snapindicator If true then a snap indicator will be displayed automatically (when enabled in the preferences)
item_to_ignore This item will not be snapped to, e.g. the item that is currently being dragged. This avoids "self-snapping"
unselected_nodes Stationary nodes of the path that is currently being edited in the node tool and that can be snapped too. Nodes not in this list will not be snapped to, to avoid "self-snapping". Of each unselected node both the position (Geom::Point) and the type (Inkscape::SnapTargetType) will be stored
guide_to_ignore Guide that is currently being dragged and should not be snapped to

Definition at line 1058 of file snap.cpp.

References _guide_to_ignore, _item_to_ignore, _items_to_ignore, _snapindicator, and _unselected_nodes.

Referenced by Inkscape::UI::ClipboardManagerImpl::_pasteDocument(), node_handle_request(), pen_handle_button_press(), and sp_nodepath_selected_nodes_move().

    g_assert(desktop != NULL);
    _item_to_ignore = item_to_ignore;
    _items_to_ignore = NULL;
    _desktop = desktop;
    _snapindicator = snapindicator;
    _unselected_nodes = unselected_nodes;
    _guide_to_ignore = guide_to_ignore;

Generated by  Doxygen 1.6.0   Back to index