summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 844b3f1)
raw | patch | inline | side by side (parent: 844b3f1)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 15 Jan 2008 19:59:14 +0000 (19:59 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 15 Jan 2008 19:59:14 +0000 (19:59 +0000) |
src/box3d.cpp | patch | blob | history |
diff --git a/src/box3d.cpp b/src/box3d.cpp
index 3c40a48000a29e18a01d93e67411c8672d153e70..f28dc8f262726dfd539dbccd5c02b2f11a3793a5 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
static void box3d_ref_changed(SPObject *old_ref, SPObject *ref, SPBox3D *box);
static void box3d_ref_modified(SPObject *href, guint flags, SPBox3D *box);
-//static void box3d_ref_changed(SPObject *old_ref, SPObject *ref, Persp3D *persp);
-//static void box3d_ref_modified(SPObject *href, guint flags, Persp3D *persp);
static SPGroupClass *parent_class;
void box3d_set_center (SPBox3D *box, NR::Point const &new_pos, NR::Point const &old_pos, const Box3D::Axis movement, bool constrained) {
g_return_if_fail ((movement != Box3D::NONE) && (movement != Box3D::XYZ));
+ box->orig_corner0.normalize();
+ box->orig_corner7.normalize();
+
Persp3D *persp = box3d_get_perspective(box);
if (!(movement & Box3D::Z)) {
double coord = (box->orig_corner0[Proj::Z] + box->orig_corner7[Proj::Z]) / 2;
@@ -625,6 +626,7 @@ void box3d_set_center (SPBox3D *box, NR::Point const &new_pos, NR::Point const &
Proj::Pt3 pt_proj (persp->tmat.preimage (new_pos, coord, Proj::Z));
if (constrained) {
Proj::Pt3 old_pos_proj (persp->tmat.preimage (old_pos, coord, Proj::Z));
+ old_pos_proj.normalize();
pt_proj = box3d_snap (box, -1, pt_proj, old_pos_proj);
}
// normalizing pt_proj is essential because we want to mingle affine coordinates