From: buliabyak Date: Mon, 6 Feb 2006 19:59:35 +0000 (+0000) Subject: crop an item's bbox by its clippath bbox, if any X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0f7095989c2fb9df2c85f07d5c30e32fb22b7878;p=inkscape.git crop an item's bbox by its clippath bbox, if any --- diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 6caa46f30..ab241a0cd 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -503,6 +503,7 @@ clip_ref_changed(SPObject *old_clip, SPObject *clip, SPItem *item) 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); } } } @@ -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)