From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/widgets/select-toolbar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/widgets/select-toolbar.cpp') diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 260c09c69..5f90a8997 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -70,7 +70,7 @@ sp_selection_layout_widget_update(SPWidget *spw, Inkscape::Selection *sel) if ( sel && !sel->isEmpty() ) { int prefs_bbox = prefs->getInt("/tools/bounding_box", 0); SPItem::BBoxType bbox_type = (prefs_bbox ==0)? - SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX; + SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX; Geom::OptRect const bbox(sel->bounds(bbox_type)); if ( bbox ) { UnitTracker *tracker = reinterpret_cast(g_object_get_data(G_OBJECT(spw), "tracker")); @@ -160,12 +160,12 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) document->ensureUpToDate (); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - Geom::OptRect bbox_vis = selection->bounds(SPItem::APPROXIMATE_BBOX); - Geom::OptRect bbox_geom = selection->bounds(SPItem::GEOMETRIC_BBOX); + Geom::OptRect bbox_vis = selection->visualBounds(); + Geom::OptRect bbox_geom = selection->geometricBounds(); int prefs_bbox = prefs->getInt("/tools/bounding_box"); SPItem::BBoxType bbox_type = (prefs_bbox == 0)? - SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX; + SPItem::VISUAL_BBOX : SPItem::GEOMETRIC_BBOX; Geom::OptRect bbox_user = selection->bounds(bbox_type); if ( !bbox_user ) { @@ -247,10 +247,10 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) int transform_stroke = prefs->getBool("/options/transform/stroke", true) ? 1 : 0; Geom::Affine scaler; - if (bbox_type == SPItem::APPROXIMATE_BBOX) { + if (bbox_type == SPItem::VISUAL_BBOX) { scaler = get_scale_transform_with_unequal_stroke (*bbox_vis, *bbox_geom, transform_stroke, x0, y0, x1, y1); } else { - // get_scale_transform_with_stroke() is intended for VISUAL (or APPROXIMATE) bounding boxes, not geometrical ones! + // get_scale_transform_with_stroke() is intended for visual bounding boxes, not geometrical ones! // we'll trick it into using a geometric bounding box though, by setting the stroke width to zero scaler = get_scale_transform_with_uniform_stroke (*bbox_user, 0, false, x0, y0, x1, y1); } -- cgit v1.2.3