diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 7339160c7cb0351cb4a3f12e1cce9240257fb556..db7f9fffd32644424d8568187dd32ce9036ca7a5 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
case SP_ATTR_TRANSFORM_CENTER_X:
if (value) {
item->transform_center_x = g_strtod(value, NULL);
+ } else {
+ item->transform_center_x = 0;
}
break;
case SP_ATTR_TRANSFORM_CENTER_Y:
if (value) {
item->transform_center_y = g_strtod(value, NULL);
+ } else {
+ item->transform_center_y = 0;
}
break;
default:
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) {
@@ -674,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)