diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-08-28 22:53:56 +0000 |
|---|---|---|
| committer | Krzysztof Kosinski <tweenk.pl@gmail.com> | 2011-08-28 22:53:56 +0000 |
| commit | f4b79d4a8edc870f099fb9194c8493ec04012ad1 (patch) | |
| tree | 2951d5171168abc288c00d09d04f5e5737e779d5 /src/extension/dbus/document-interface.cpp | |
| parent | Tie the snapping of rectangle corners and quadrant points of ellipses to the ... (diff) | |
| parent | Completely remove libnr (diff) | |
| download | inkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.tar.gz inkscape-f4b79d4a8edc870f099fb9194c8493ec04012ad1.zip | |
Completely remove libnr
(bzr r10589)
Diffstat (limited to 'src/extension/dbus/document-interface.cpp')
| -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; } /* |
