diff options
author | Martin Poirier <theeth@yahoo.com> | 2006-04-11 04:24:07 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2006-04-11 04:24:07 +0400 |
commit | 3f8a120ca29d0b09632f4ccae48ecf7285419804 (patch) | |
tree | 1cb1357d50e32eb61ec968fe72886416fd02adb5 /source/blender/src/view.c | |
parent | 32e516695e7883f949eab4204667cf9709cd6ee0 (diff) |
=== Transform ===
Bug #3779: In camera view with center cursor (on camera), it's impossible to use translations.
Initgrabz didn't account for negative zero values (nor near zero values). Works now.
Of course, this is just a safety to give back the appearance of working, since the cursor is on the point of convergence, there's no way to properly calibrate anything.
Word of advice: Always check where the transform center is.
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r-- | source/blender/src/view.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 576813ded26..6c27168c0b1 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -144,14 +144,16 @@ void initgrabz(float x, float y, float z) { if(G.vd==0) return; zfac= G.vd->persmat[0][3]*x+ G.vd->persmat[1][3]*y+ G.vd->persmat[2][3]*z+ G.vd->persmat[3][3]; - - /* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that */ - if (zfac==0.0f) zfac = 1.0f; + + /* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that + * (accounting for near zero values) + * */ + if (zfac < 1.e-6f && zfac > -1.e-6f) zfac = 1.0f; } void window_to_3d(float *vec, short mx, short my) { - /* always call initzgrab */ + /* always call initgrabz */ float dx, dy; dx= 2.0f*mx*zfac/curarea->winx; |