summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: acd2b4f)
raw | patch | inline | side by side (parent: acd2b4f)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 22 Mar 2006 18:26:47 +0000 (18:26 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 22 Mar 2006 18:26:47 +0000 (18:26 +0000) |
src/sp-clippath.cpp | patch | blob | history |
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 35e0738791e825f0d29895f236ef6de43999760a..501b5fcfd91caf5aea8d870a1d55e5f69bad4153 100644 (file)
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
#include "document-private.h"
#include "sp-item.h"
+#include "libnr/nr-matrix-ops.h"
+
#include "sp-clippath.h"
struct SPClipPathView {
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);
- }
- }
+ SPObject *i;
+ for (i = sp_object_first_child(SP_OBJECT(cp)); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i));
+ if (!i) return;
+
+ sp_item_invoke_bbox_full(SP_ITEM(i), bbox, NR::Matrix(SP_ITEM(i)->transform) * transform, flags, FALSE);
+ SPObject *i_start = i;
+
+ while (i != NULL) {
+ if (i != i_start) {
+ NRRect i_box;
+ sp_item_invoke_bbox_full(SP_ITEM(i), &i_box, NR::Matrix(SP_ITEM(i)->transform) * transform, flags, FALSE);
+ nr_rect_d_union (bbox, bbox, &i_box);
+ }
+ i = SP_OBJECT_NEXT(i);
+ for (; i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i));
+ }
}
/* ClipPath views */