diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-11 21:23:04 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-11 21:23:04 +0000 |
| commit | 4e432e5960cb8bc9feb6648087b54788c774d773 (patch) | |
| tree | f83b7730dfb4ff96d45fb96e83367ab3dc28e56f /src/display/sp-canvas.cpp | |
| parent | Switch selection bounds and center to use NR::Maybe, addressing most of the (diff) | |
| download | inkscape-4e432e5960cb8bc9feb6648087b54788c774d773.tar.gz inkscape-4e432e5960cb8bc9feb6648087b54788c774d773.zip | |
Eliminate remaining sources of empty NR::Rects
(bzr r2605)
Diffstat (limited to 'src/display/sp-canvas.cpp')
| -rw-r--r-- | src/display/sp-canvas.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 75ffeed84..559515e03 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -744,11 +744,16 @@ sp_canvas_group_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i } } - NR::Rect const &bounds = corners.bounds(); - item->x1 = bounds.min()[NR::X]; - item->y1 = bounds.min()[NR::Y]; - item->x2 = bounds.max()[NR::X]; - item->y2 = bounds.max()[NR::Y]; + NR::Maybe<NR::Rect> const bounds = corners.bounds(); + if (bounds) { + item->x1 = bounds->min()[NR::X]; + item->y1 = bounds->min()[NR::Y]; + item->x2 = bounds->max()[NR::X]; + item->y2 = bounds->max()[NR::Y]; + } else { + item->x1 = item->x2 = corners.midpoint()[NR::X]; + item->y1 = item->y2 = corners.midpoint()[NR::Y]; + } } /** |
