summaryrefslogtreecommitdiffstats
path: root/src/display/sp-canvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/sp-canvas.cpp')
-rw-r--r--src/display/sp-canvas.cpp15
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];
+ }
}
/**