snap-preferences.cpp revision 5766ce1b38b9e065be5b47b0c025b577769f16aa
#define __SNAPPREFERENCES_CPP__
/**
* \file snap-preferences.cpp
* \brief Storing of snapping preferences
*
* Authors:
* Diederik van Lierop <mail@diedenrezi.nl>
*
* Copyright (C) 2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "inkscape.h"
#include "snap-preferences.h"
_include_item_center(false),
_intersectionGG(true),
_snap_to_grids(true),
_snap_to_guides(true),
_snap_enabled_globally(true),
_snap_postponed_globally(false),
_snap_to_itemnode(true), _snap_to_itempath(true),
_snap_to_bboxnode(true), _snap_to_bboxpath(true),
_snap_to_page_border(false),
_strict_snapping(true)
{
setSnapFrom(SNAPPOINT_BBOX | SNAPPOINT_NODE | SNAPPOINT_GUIDE, true); //Snap any point. In v0.45 and earlier, this was controlled in the preferences tab
}
/*
* The snappers have too many parameters to adjust individually. Therefore only
* two snapping modes are presented to the user: snapping bounding box corners (to
* paths, grids or guides). To select either of these modes (or both), use the
* methods defined below: setSnapModeBBox() and setSnapModeNode().
*
* */
{
if (enabled) {
} else {
}
}
{
}
{
if (enabled) {
} else {
}
}
{
}
{
return (_snap_from & (Inkscape::SnapPreferences::SNAPPOINT_BBOX | Inkscape::SnapPreferences::SNAPPOINT_NODE) );
}
{
return (_snap_from != 0);
}
{
if (enabled) {
} else {
}
}
{
}
/**
* \param t Point type.
* \param s true to snap to this point type, otherwise false;
*/
{
if (s) {
_snap_from |= t;
} else {
_snap_from &= ~t;
}
}
/**
* \param t Point type.
* \return true if snapper will snap this type of point, otherwise false.
*/
{
return (_snap_from & t);
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :