From: cilix42 Date: Tue, 7 Aug 2007 14:44:02 +0000 (+0000) Subject: Update current perspective when selection changes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=edf9f2ecb04b7679de364444c7b3285f544fb643;p=inkscape.git Update current perspective when selection changes --- diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 388e2037d..de1a4e2bf 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -191,6 +191,22 @@ void sp_3dbox_context_selection_changed(Inkscape::Selection *selection, gpointer Inkscape::GC::anchor(shape_repr); sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec); } + if (SP_IS_3DBOX (item)) { + Box3D::Perspective3D::current_perspective = Box3D::get_persp_of_box (SP_3DBOX (item)); + } + } else { + /* If several boxes sharing the same perspective are selected, + we can still set the current selection accordingly */ + std::set perspectives; + for (GSList *i = (GSList *) selection->itemList(); i != NULL; i = i->next) { + if (SP_IS_3DBOX (i->data)) { + perspectives.insert (Box3D::get_persp_of_box (SP_3DBOX (i->data))); + } + } + if (perspectives.size() == 1) { + Box3D::Perspective3D::current_perspective = *(perspectives.begin()); + } + // TODO: What to do if several boxes with different perspectives are selected? } }