From a1479b4243eb52e35a397725b5741c479c5f9c03 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 6 Feb 2006 19:58:47 +0000 Subject: [PATCH] add a method to get bbox of a clippath, fix the update-while-update warnings --- src/sp-clippath.cpp | 12 +++++++++++- src/sp-clippath.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index d8d2acc9f..4b9ffb76c 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -352,13 +352,23 @@ sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox) !NR_DF_TEST_CLOSE(v->bbox.x1, bbox->x1, NR_EPSILON) || !NR_DF_TEST_CLOSE(v->bbox.y1, bbox->y1, NR_EPSILON)) { v->bbox = *bbox; - SP_OBJECT(cp)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } break; } } } +void +sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, NR::Matrix const &transform, unsigned const flags) +{ + for (SPObject *o = sp_object_first_child(SP_OBJECT(cp)); o != NULL; o = SP_OBJECT_NEXT(o)) { + if (SP_IS_ITEM(o)) { + SPItem *child = SP_ITEM(o); + sp_item_invoke_bbox_full(child, bbox, transform, flags, FALSE); + } + } +} + /* ClipPath views */ SPClipPathView * diff --git a/src/sp-clippath.h b/src/sp-clippath.h index 1f5571cc1..0a8b92fa9 100644 --- a/src/sp-clippath.h +++ b/src/sp-clippath.h @@ -57,5 +57,6 @@ NRArenaItem *sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key); void sp_clippath_hide(SPClipPath *cp, unsigned int key); void sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox); +void sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, NR::Matrix const &transform, unsigned const flags); #endif -- 2.30.2