diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 6caa46f3016b9b1959c1bd7d92ec4f65e088f50c..9f1126185213dec8af9ed99f95f9196fb2bc6c27 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
#endif
-
+#include "sp-item.h"
#include "svg/svg.h"
#include "print.h"
#include "display/nr-arena.h"
nr_arena_item_set_clip(v->arenaitem, ai);
nr_arena_item_unref(ai);
sp_clippath_set_bbox(SP_CLIPPATH(clip), NR_ARENA_ITEM_GET_KEY(v->arenaitem), &bbox);
+ SP_OBJECT(clip)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
}
}
repr->setAttribute("sodipodi:insensitive", ( item->sensitive ? NULL : "true" ));
if (item->transform_center_x != 0)
sp_repr_set_svg_double (repr, "inkscape:transform-center-x", item->transform_center_x);
- else
+ else
repr->setAttribute ("inkscape:transform-center-x", NULL);
if (item->transform_center_y != 0)
sp_repr_set_svg_double (repr, "inkscape:transform-center-y", item->transform_center_y);
- else
- repr->setAttribute ("inkscape:transform-center-y", NULL);
+ else
+ repr->setAttribute ("inkscape:transform-center-y", NULL);
}
if (((SPObjectClass *) (parent_class))->write) {
@@ -678,6 +679,13 @@ sp_item_invoke_bbox_full(SPItem const *item, NRRect *bbox, NR::Matrix const &tra
if (((SPItemClass *) G_OBJECT_GET_CLASS(item))->bbox) {
((SPItemClass *) G_OBJECT_GET_CLASS(item))->bbox(item, bbox, transform, flags);
}
+
+ // crop the bbox by clip path, if any
+ if (item->clip_ref->getObject()) {
+ NRRect b;
+ sp_clippath_get_bbox(SP_CLIPPATH(item->clip_ref->getObject()), &b, transform, flags);
+ nr_rect_d_intersect (bbox, bbox, &b);
+ }
}
unsigned sp_item_pos_in_parent(SPItem *item)