summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb5b9ad)
raw | patch | inline | side by side (parent: eb5b9ad)
author | sasilver <sasilver@users.sourceforge.net> | |
Thu, 3 Jul 2008 09:19:46 +0000 (09:19 +0000) | ||
committer | sasilver <sasilver@users.sourceforge.net> | |
Thu, 3 Jul 2008 09:19:46 +0000 (09:19 +0000) |
Fixes crash that occurs when transforming a 3D box with a title or description (bug 237331).
src/box3d.cpp | patch | blob | history |
diff --git a/src/box3d.cpp b/src/box3d.cpp
index 2a8d24167c4fdf9ff4f0cb99cd71ed693004b123..f0bf4647d6b25d1065f106f509e978eb04b918c7 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
/* This draws the curve and calls requestDisplayUpdate() for each side (the latter is done in
box3d_side_position_set() to avoid update conflicts with the parent box) */
for (SPObject *child = sp_object_first_child(SP_OBJECT (box)); child != NULL; child = SP_OBJECT_NEXT(child) ) {
- box3d_side_position_set (SP_BOX3D_SIDE (child));
+ if (SP_IS_BOX3D_SIDE(child))
+ box3d_side_position_set(SP_BOX3D_SIDE(child));
}
}
gdouble const sw = hypot(ret[0], ret[1]);
gdouble const sh = hypot(ret[2], ret[3]);
- SPItem *sideitem = NULL;
- for (SPObject *side = sp_object_first_child(box); side != NULL; side = SP_OBJECT_NEXT(side)) {
- sideitem = SP_ITEM(side);
+ for (SPObject *child = sp_object_first_child(box); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ if (SP_IS_ITEM(child)) {
+ SPItem *childitem = SP_ITEM(child);
- // Adjust stroke width
- sp_item_adjust_stroke(sideitem, sqrt(fabs(sw * sh)));
+ // Adjust stroke width
+ sp_item_adjust_stroke(childitem, sqrt(fabs(sw * sh)));
- // Adjust pattern fill
- sp_item_adjust_pattern(sideitem, xform);
+ // Adjust pattern fill
+ sp_item_adjust_pattern(childitem, xform);
- // Adjust gradient fill
- sp_item_adjust_gradient(sideitem, xform);
+ // Adjust gradient fill
+ sp_item_adjust_gradient(childitem, xform);
- // Adjust LPE
- sp_item_adjust_livepatheffect(item, xform);
+ // Adjust LPE
+ sp_item_adjust_livepatheffect(childitem, xform);
+ }
}
return NR::identity();
box3d_get_sides (SPBox3D *box) {
std::map<int, Box3DSide *> sides;
for (SPObject *side = sp_object_first_child(box); side != NULL; side = SP_OBJECT_NEXT(side)) {
- sides[Box3D::face_to_int(sp_repr_get_int_attribute(SP_OBJECT_REPR(side),
- "inkscape:box3dsidetype", -1))] = SP_BOX3D_SIDE(side);
+ if (SP_IS_BOX3D_SIDE(side))
+ sides[Box3D::face_to_int(sp_repr_get_int_attribute(SP_OBJECT_REPR(side),
+ "inkscape:box3dsidetype", -1))] = SP_BOX3D_SIDE(side);
}
sides.erase(-1);
return sides;