From 8fcb1463fbb68c81d6cf4695f7ef295157938cec Mon Sep 17 00:00:00 2001 From: cilix42 Date: Tue, 7 Aug 2007 07:37:23 +0000 Subject: [PATCH] Don't reshape boxes in the direction of infinite VPs when dragging VPs (fixes resizing bug) --- src/perspective3d.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/perspective3d.cpp b/src/perspective3d.cpp index bb4963d11..421725bdb 100644 --- a/src/perspective3d.cpp +++ b/src/perspective3d.cpp @@ -296,18 +296,24 @@ Perspective3D::reshape_boxes (Box3D::Axis axes) SP3DBox *box = SP_3DBOX (i->data); if (axes & Box3D::X) { vp = this->get_vanishing_point (Box3D::X); - new_pt = vp->get_pos() + box->ratio_x * (box->corners[3] - vp->get_pos()); - sp_3dbox_move_corner_in_XY_plane (box, 2, new_pt); + if (vp->is_finite()) { + new_pt = vp->get_pos() + box->ratio_x * (box->corners[3] - vp->get_pos()); + sp_3dbox_move_corner_in_XY_plane (box, 2, new_pt); + } } if (axes & Box3D::Y) { vp = this->get_vanishing_point (Box3D::Y); - new_pt = vp->get_pos() + box->ratio_y * (box->corners[0] - vp->get_pos()); - sp_3dbox_move_corner_in_XY_plane (box, 2, new_pt); + if (vp->is_finite()) { + new_pt = vp->get_pos() + box->ratio_y * (box->corners[0] - vp->get_pos()); + sp_3dbox_move_corner_in_XY_plane (box, 2, new_pt); + } } if (axes & Box3D::Z) { vp = this->get_vanishing_point (Box3D::Z); - new_pt = vp->get_pos() + box->ratio_z * (box->corners[0] - vp->get_pos()); - sp_3dbox_move_corner_in_Z_direction (box, 4, new_pt); + if (vp->is_finite()) { + new_pt = vp->get_pos() + box->ratio_z * (box->corners[0] - vp->get_pos()); + sp_3dbox_move_corner_in_Z_direction (box, 4, new_pt); + } } sp_3dbox_set_shape (box, true); -- 2.30.2