From 30493d6d028485e65dd0fb61ea9978c7b128e817 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Sun, 13 Jan 2008 18:17:32 +0000 Subject: Use visual/geometric bbox (as specified in Selector tool preferences) when converting to guidelines. Also, provide options to convert rectangles and 3D boxes using their bbox, too (i.e., disregarding their true shapes). (bzr r4477) --- src/sp-item.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/sp-item.cpp') diff --git a/src/sp-item.cpp b/src/sp-item.cpp index f24bf6ecc..7b3687607 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -34,6 +34,8 @@ #include "attributes.h" #include "document.h" #include "uri.h" +#include "inkscape.h" +#include "desktop-handles.h" #include "style.h" #include @@ -1579,9 +1581,15 @@ sp_item_first_item_child (SPObject *obj) void sp_item_convert_to_guides(SPItem *item) { - NR::Maybe bbox = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX); + SPDesktop *dt = inkscape_active_desktop(); + SPNamedView *nv = sp_desktop_namedview(dt); + + gchar const *prefs_bbox = prefs_get_string_attribute("tools.select", "bounding_box"); + SPItem::BBoxType bbox_type = (prefs_bbox != NULL && strcmp(prefs_bbox, "geometric")==0)? SPItem::GEOMETRIC_BBOX : SPItem::RENDERING_BBOX; + + NR::Maybe bbox = sp_item_bbox_desktop(item, bbox_type); if (!bbox) { - g_print ("Cannot determine bounding box. Doing nothing.\n"); + g_warning ("Cannot determine item's bounding box during conversion to guides.\n"); return; } -- cgit v1.2.3