diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-04-11 18:00:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-04-11 18:00:11 +0400 |
commit | 384f7a7875239861de5c36f034271c1621b9de51 (patch) | |
tree | 38d0e3d7284a75b0c0bddda6aed4b3a3c1015ad6 /source | |
parent | 2d0b69f3c3b1492d822132836756508fab9c06af (diff) |
mesh_wire, fixed error with zero area edges
Holding Ctrl flips the align view in editmode. (patch from BeBraw)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/space.c | 8 | ||||
-rw-r--r-- | source/blender/src/view.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 6bebd6126af..22c178ad2dd 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -636,11 +636,13 @@ static void changeview3dspace(ScrArea *sa, void *spacedata) */ static void align_view_to_selected(View3D *v3d) { - int nr= pupmenu("Align View%t|To Selected (top)%x2|To Selected (front)%x1|To Selected (side)%x0"); - + int nr= pupmenu("Align View (Ctrl flips)%t|To Selected (top)%x3|To Selected (front)%x2|To Selected (side)%x1"); if (nr!=-1) { int axis= nr; - + + /* opposite axis in case ctrl is pressed */ + if(G.qual==LR_CTRLKEY) axis= -axis; + if ((G.obedit) && (G.obedit->type == OB_MESH)) { editmesh_align_view_to_selected(v3d, axis); addqueue(v3d->area->win, REDRAW, 1); diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 83ee44eaacd..826f3b07917 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -1505,7 +1505,9 @@ void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3]) float norm[3], axis[3], angle, new_quat[4]; alignaxis[0]= alignaxis[1]= alignaxis[2]= 0.0; - alignaxis[axisidx]= 1.0; + + if(axisidx > 0) alignaxis[axisidx-1]= 1.0; + else alignaxis[-axisidx-1]= -1.0; norm[0]= vec[0], norm[1]= vec[1], norm[2]= vec[2]; Normalize(norm); |