summaryrefslogtreecommitdiffstats
path: root/src/box3d-context.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-07-14 14:51:56 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-07-14 14:51:56 +0000
commit01616ad9d6084dc6ef4fc14622b018ee582431d2 (patch)
tree18b19bc71561e666249d6c0021e2700561fa9909 /src/box3d-context.cpp
parentFilter effects dialog: (diff)
downloadinkscape-01616ad9d6084dc6ef4fc14622b018ee582431d2.tar.gz
inkscape-01616ad9d6084dc6ef4fc14622b018ee582431d2.zip
Write distinguished corners of 3D boxes to the svg representation from which the box can be recomputed.
This is used to fix several bugs related to the editing of boxes resulting from cloning, undo operations or newly opened documents (we had stray pointers to SPPaths before that made Inkscape crash). (bzr r3239)
Diffstat (limited to 'src/box3d-context.cpp')
-rw-r--r--src/box3d-context.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 6eaedfb78..0bcf9ffa4 100644
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -203,6 +203,14 @@ void sp_3dbox_context_selection_changed(Inkscape::Selection *selection, gpointer
ec->shape_repr = shape_repr;
Inkscape::GC::anchor(shape_repr);
sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec);
+
+ // FIXME: The following really belongs in sp_3dbox_build. But when undoing & redoing the
+ // creation of a 3D box, we have no means of accessing the recreated paths, which
+ // seem to be built after the box itself. Thus we need to check for untracked paths
+ // here and hook them to the box if the latter was created by a redo operation.
+ if (SP_IS_3DBOX(item)) {
+ sp_3dbox_link_to_existing_paths (SP_3DBOX(item), shape_repr);
+ }
}
}
}
@@ -577,7 +585,7 @@ static void sp_3dbox_finish(SP3DBoxContext *rc)
sp_desktop_selection(desktop)->set(rc->item);
sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
- _("Create 3d box"));
+ _("Create 3D box"));
rc->item = NULL;
}