diff options
| author | Peter Moulder <peter.moulder@monash.edu> | 2007-05-20 08:28:40 +0000 |
|---|---|---|
| committer | pjrm <pjrm@users.sourceforge.net> | 2007-05-20 08:28:40 +0000 |
| commit | 9c0a99a22522b9a49a42eb2b80466bcc183c69fc (patch) | |
| tree | 4ee474a9eea47d7c19bcf82a77c9fa510f6ab15e /src/selection-chemistry.cpp | |
| parent | doc (diff) | |
| download | inkscape-9c0a99a22522b9a49a42eb2b80466bcc183c69fc.tar.gz inkscape-9c0a99a22522b9a49a42eb2b80466bcc183c69fc.zip | |
noop: Change fitToRect to take NR::Rect instead of old NRRect. Update callers.
(bzr r3032)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 2b13021a2..bd1f54b6b 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2843,23 +2843,21 @@ void fit_canvas_to_selection(SPDesktop *desktop) { g_return_if_fail(doc != NULL); g_return_if_fail(desktop->selection != NULL); g_return_if_fail(!desktop->selection->isEmpty()); - NRRect bbox(0, 0, 0, 0); - desktop->selection->bounds(&bbox); - if (!nr_rect_d_test_empty(&bbox)) { - doc->fitToRect(bbox); + NR::Maybe<NR::Rect> const bbox(desktop->selection->bounds()); + if (bbox && !bbox->isEmpty()) { + doc->fitToRect(*bbox); } }; void fit_canvas_to_drawing(SPDocument *doc) { g_return_if_fail(doc != NULL); - NRRect bbox(0, 0, 0, 0); - sp_document_ensure_up_to_date (doc); - sp_item_invoke_bbox(SP_ITEM(doc->root), &bbox, sp_item_i2r_affine(SP_ITEM(doc->root)), TRUE); - - if (!nr_rect_d_test_empty(&bbox)) { - doc->fitToRect(bbox); + sp_document_ensure_up_to_date(doc); + SPItem const *const root = SP_ITEM(doc->root); + NR::Maybe<NR::Rect> const bbox(root->getBounds(sp_item_i2r_affine(root))); + if (bbox && !bbox->isEmpty()) { + doc->fitToRect(*bbox); } }; |
