diff --git a/src/box3d.cpp b/src/box3d.cpp
index 5e67f46ab33b148e2a14833968c50fd8c2fc9369..ff00a795c57505d50c8475fa83ed835cd16e4740 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
{
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
SP3DBox *box = SP_3DBOX(object);
- sp_3dbox_link_to_existing_paths (box, SP_OBJECT_REPR(object));
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(object);
+ sp_3dbox_link_to_existing_paths (box, repr);
+ SPEventContext *ec = inkscape_active_event_context();
+ if (SP_IS_3DBOX_CONTEXT (ec)) {
+ SP_3DBOX_CONTEXT (ec)->_vpdrag->updateDraggers();
+ // FIXME: Should we update the corners here, too? Maybe this is the reason why the handles
+ // are off after an undo/redo! On the other hand, if we do so we get warnings about
+ // updates occuring while other updats are in progress ...
+ }
}
/* Invoke parent method */
}
}
+void
+sp_3dbox_reshape_after_VP_rotation (SP3DBox *box, Box3D::Axis axis)
+{
+ Box3D::Perspective3D *persp = inkscape_active_document()->get_persp_of_box (box);
+ Box3D::VanishingPoint *vp = persp->get_vanishing_point (axis);
+
+ guint c1 = (axis == Box3D::Z) ? 1 : sp_3dbox_get_front_corner_id (box); // hack
+ guint c2 = c1 ^ axis;
+ NR::Point v = box->corners[c1] - box->corners[c2];
+ double dist = NR::L2 (v) * ((NR::dot (v, vp->v_dir) < 0) ? 1 : -1); // "directed" distance
+
+ Box3D::PerspectiveLine pline (box->corners[c1], axis, persp);
+ NR::Point pt = pline.point_from_lambda (dist);
+
+ sp_3dbox_move_corner_in_Z_direction (box, c2, pt, axis == Box3D::Z);
+}
+
void
sp_3dbox_move_corner_in_XY_plane (SP3DBox *box, guint id, NR::Point pt, Box3D::Axis axes)
{