diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-02-06 19:59:35 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-02-06 19:59:35 +0000 |
| commit | a0ec9655c41011815ee6be68f6c547cb633995bf (patch) | |
| tree | 4303ca5d34f46a8c1f876c1671e7cb9e1d370358 /src/sp-item.cpp | |
| parent | add a method to get bbox of a clippath, fix the update-while-update warnings (diff) | |
| download | inkscape-a0ec9655c41011815ee6be68f6c547cb633995bf.tar.gz inkscape-a0ec9655c41011815ee6be68f6c547cb633995bf.zip | |
crop an item's bbox by its clippath bbox, if any
(bzr r99)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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) |
