summaryrefslogtreecommitdiffstats
path: root/src/display/sp-canvas.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-02-19 19:56:03 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2012-02-19 19:56:03 +0000
commit5014662ec90a3ec0eb1c5fc261063415eb3f09e0 (patch)
tree237e911051fa8be167957d3bbfaf0a9a70006d8d /src/display/sp-canvas.cpp
parentbad bug in 2geom (diff)
downloadinkscape-5014662ec90a3ec0eb1c5fc261063415eb3f09e0.tar.gz
inkscape-5014662ec90a3ec0eb1c5fc261063415eb3f09e0.zip
remove superfluous RectHull
(bzr r11001)
Diffstat (limited to 'src/display/sp-canvas.cpp')
-rw-r--r--src/display/sp-canvas.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index cecde3fa0..580b214f0 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -22,7 +22,7 @@
#include <gtk/gtk.h>
#include "helper/sp-marshal.h"
-#include <2geom/rect-hull.h>
+#include <2geom/rect.h>
#include <2geom/affine.h>
#include "display/sp-canvas.h"
#include "display/sp-canvas-group.h"
@@ -972,26 +972,19 @@ void SPCanvasGroup::destroy(GtkObject *object)
void SPCanvasGroup::update(SPCanvasItem *item, Geom::Affine const &affine, unsigned int flags)
{
SPCanvasGroup const *group = SP_CANVAS_GROUP(item);
- Geom::RectHull corners(Geom::Point(0, 0));
- bool empty=true;
+ Geom::OptRect bounds;
for (GList *list = group->items; list; list = list->next) {
SPCanvasItem *i = (SPCanvasItem *)list->data;
sp_canvas_item_invoke_update (i, affine, flags);
- if ( i->x2 > i->x1 && i->y2 > i->y1 ) {
- if (empty) {
- corners = Geom::RectHull(Geom::Point(i->x1, i->y1));
- empty = false;
- } else {
- corners.add(Geom::Point(i->x1, i->y1));
- }
- corners.add(Geom::Point(i->x2, i->y2));
+ if ( (i->x2 > i->x1) && (i->y2 > i->y1) ) {
+ bounds.expandTo(Geom::Point(i->x1, i->y1));
+ bounds.expandTo(Geom::Point(i->x2, i->y2));
}
}
- Geom::OptRect const bounds = corners.bounds();
if (bounds) {
item->x1 = bounds->min()[Geom::X];
item->y1 = bounds->min()[Geom::Y];