summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61a8e3b)
raw | patch | inline | side by side (parent: 61a8e3b)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 17 Apr 2008 02:40:23 +0000 (02:40 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Thu, 17 Apr 2008 02:40:23 +0000 (02:40 +0000) |
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index f05422770471c8729936cbe65e5228f5fe6cd503..a9101415871be476db5f5da65f0bb105aa939dec 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
@@ -156,8 +156,9 @@ void Inkscape::ObjectSnapper::_collectNodes(Inkscape::Snapper::PointType const &
g_assert(!(p_is_a_node && p_is_a_bbox || p_is_a_bbox && p_is_a_guide || p_is_a_node && p_is_a_guide));
if (_snap_to_bboxnode) {
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
}
for (std::vector<SPItem*>::const_iterator i = _candidates->begin(); i != _candidates->end(); i++) {
@@ -265,8 +266,9 @@ void Inkscape::ObjectSnapper::_collectPaths(Inkscape::Snapper::PointType const &
bool p_is_a_node = t & Inkscape::Snapper::SNAPPOINT_NODE;
if (_snap_to_bboxpath) {
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
}
// Consider the page border for snapping
index 03e3dc487d623f21f208268aa54001d02975fcc9..0bf035c1f75dd88a4944f2efc3e69b80f813ea95 100644 (file)
" </group>\n"
"\n"
" <group id=\"tools\"\n"
+" bounding_box=\"0\"\n"
" style=\"fill:none;stroke:black;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;\">\n"
" <group id=\"shapes\" style=\"fill-rule:evenodd;\" selcue=\"1\" gradientdrag=\"1\">\n"
" <eventcontext id=\"rect\" style=\"fill:blue;\" usecurrent=\"1\"/>\n"
diff --git a/src/selcue.cpp b/src/selcue.cpp
index 4eba1f7560e3d3dfd7d89c06202117c6e4e7ff9c..48df1cf8a814478f7bc07cf3e1b071a48919a33f 100644 (file)
--- a/src/selcue.cpp
+++ b/src/selcue.cpp
g_return_if_fail(_selection != NULL);
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- SPItem::BBoxType bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ SPItem::BBoxType bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
for (GSList const *l = _selection->itemList(); l != NULL; l = l->next) {
SPItem *item = (SPItem *) l->data;
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 154e828c41bd5eab90cfe7c3258fef92787f191e..c90ac31cf519ba2efd3200825ab0fa6572425d9e 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
_stamp_cache(NULL),
_message_context(desktop->messageStack())
{
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- _snap_bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ _snap_bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
g_return_if_fail(desktop != NULL);
{
if (!_grabbed) {
// reread in case it changed on the fly:
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- _snap_bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::APPROXIMATE_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ _snap_bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
//SPItem::APPROXIMATE_BBOX will be replaced by SPItem::VISUAL_BBOX, as soon as the latter is implemented properly
_updateVolatileState();
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 263671d476e911b026e2ef458efb35138e788704..0ab8566eb9479e369760d50616807107da370c23 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
SPNamedView *nv = sp_desktop_namedview(dt);
(void)nv;
- gchar const *prefs_bbox = prefs_get_string_attribute("tools", "bounding_box");
- SPItem::BBoxType bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::RENDERING_BBOX;
+ int prefs_bbox = prefs_get_int_attribute("tools", "bounding_box", 0);
+ SPItem::BBoxType bbox_type = (prefs_bbox ==0)?
+ SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
NR::Maybe<NR::Rect> bbox = sp_item_bbox_desktop(item, bbox_type);
if (!bbox) {
index 5c451e00561fb69474975cdd92d5e1187952f088..6b9cafcc9a82345ed1309bf65447b42839597e9b 100644 (file)
_path_tools = _page_list.get_model()->get_path(iter_tools);
_page_tools.add_group_header( _("Bounding box to use:"));
- _t_bbox_visual.init ( _("Visual bounding box"), "tools", "bounding_box", "visual", false, 0);
+ _t_bbox_visual.init ( _("Visual bounding box"), "tools", "bounding_box", "0", false, 0); // 0 means visual
_page_tools.add_line( true, "", _t_bbox_visual, "",
_("This bounding box includes stroke width, markers, filter margins, etc."));
- _t_bbox_geometric.init ( _("Geometric bounding box"), "tools", "bounding_box", "geometric", true, &_t_bbox_visual);
+ _t_bbox_geometric.init ( _("Geometric bounding box"), "tools", "bounding_box", "1", true, &_t_bbox_visual); // 1 means geometric
_page_tools.add_line( true, "", _t_bbox_geometric, "",
_("This bounding box includes only the bare path"));