From de43f9fc6fc4f6f8e716924c7c6f1242d4b036a3 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Mon, 6 Aug 2007 07:37:24 +0000 Subject: First stage of draggable vanishing points (no snapping/unsnapping yet) (bzr r3391) --- src/box3d-context.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/box3d-context.cpp') diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 5f1029576..3096ad179 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -113,6 +113,8 @@ static void sp_3dbox_context_init(SP3DBoxContext *box3d_context) box3d_context->ctrl_dragged = false; box3d_context->extruded = false; + box3d_context->_vpdrag = NULL; + new (&box3d_context->sel_changed_connection) sigc::connection(); } @@ -123,6 +125,9 @@ static void sp_3dbox_context_dispose(GObject *object) ec->enableGrDrag(false); + delete (bc->_vpdrag); + bc->_vpdrag = NULL; + bc->sel_changed_connection.disconnect(); bc->sel_changed_connection.~connection(); @@ -213,6 +218,8 @@ static void sp_3dbox_context_setup(SPEventContext *ec) sigc::bind(sigc::ptr_fun(&sp_3dbox_context_selection_changed), (gpointer)bc) ); + bc->_vpdrag = new Box3D::VPDrag(ec->desktop); + if (prefs_get_int_attribute("tools.shapes", "selcue", 0) != 0) { ec->enableSelectionCue(); } @@ -520,6 +527,9 @@ static void sp_3dbox_drag(SP3DBoxContext &bc, guint state) } bc.item->updateRepr(); + // TODO: It would be nice to show the VPs during dragging, but since there is no selection + // at this point (only after finishing the box), we must do this "manually" + bc._vpdrag->updateDraggers(); sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5); } -- cgit v1.2.3