From 01616ad9d6084dc6ef4fc14622b018ee582431d2 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Sat, 14 Jul 2007 14:51:56 +0000 Subject: 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) --- src/box3d-context.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/box3d-context.cpp') 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; } -- cgit v1.2.3