diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-08-27 09:04:37 +0000 |
|---|---|---|
| committer | Krzysztof Kosinski <tweenk.pl@gmail.com> | 2011-08-27 09:04:37 +0000 |
| commit | 72cc39b9f0b340548f395c7f61ca9662b34aea09 (patch) | |
| tree | 34a0853cff6c6040bc2a0572dfa365280fce2601 /src/extension/dbus/document-interface.cpp | |
| parent | Fix "snap guides" toggle (diff) | |
| download | inkscape-72cc39b9f0b340548f395c7f61ca9662b34aea09.tar.gz inkscape-72cc39b9f0b340548f395c7f61ca9662b34aea09.zip | |
Refactor SPItem bounding box methods: remove NRRect usage and make code
using them more obvious. Fix filter region computation.
(bzr r10582.1.1)
Diffstat (limited to '')
| -rw-r--r-- | src/extension/dbus/document-interface.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index 1e6577173..b4f42a37d 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -157,16 +157,14 @@ desktop_ensure_active (SPDesktop* desk) { gdouble selection_get_center_x (Inkscape::Selection *sel){ - NRRect *box = g_new(NRRect, 1);; - box = sel->boundsInDocument(box); - return box->x0 + ((box->x1 - box->x0)/2); + Geom::OptRect box = sel->documentBounds(SPItem::GEOMETRIC_BBOX); + return box ? box->midpoint()[Geom::X] : 0; } gdouble selection_get_center_y (Inkscape::Selection *sel){ - NRRect *box = g_new(NRRect, 1);; - box = sel->boundsInDocument(box); - return box->y0 + ((box->y1 - box->y0)/2); + Geom::OptRect box = sel->documentBounds(SPItem::GEOMETRIC_BBOX); + return box ? box->midpoint()[Geom::X] : 0; } /* |
