On click-release for Manipulator handles, without moving mouse, it will

stick to transform() until another mouse press (or ESC etc)
This commit is contained in:
Ton Roosendaal
2005-05-04 15:13:25 +00:00
parent 3b2c30dae4
commit 6db7d23b5f
2 changed files with 9 additions and 3 deletions

View File

@@ -572,7 +572,7 @@ void Transform(int mode, int context)
void ManipulatorTransform(int mode)
{
int ret_val = 0;
int ret_val = 0, mouse_moved = 0;
short pmval[2] = {0, 0}, mval[2], val;
unsigned short event;
@@ -648,6 +648,10 @@ void ManipulatorTransform(int mode)
event= extern_qread(&val);
switch (event){
case MOUSEX:
case MOUSEY:
mouse_moved = 1;
break;
/* enforce redraw of transform when modifiers are used */
case LEFTCTRLKEY:
case RIGHTCTRLKEY:
@@ -669,6 +673,8 @@ void ManipulatorTransform(int mode)
ret_val = TRANS_CANCEL;
break;
case LEFTMOUSE:
if(mouse_moved==0 && val==0) break;
// else we pass on event to next, which cancels
case SPACEKEY:
case PADENTER:
case RETKEY:

View File

@@ -162,7 +162,7 @@ static void stats_pose(ListBase *lb, float *normal, float *plane)
/* centroid, boundbox, of selection */
/* returns total items selected */
static int calc_manipulator(ScrArea *sa)
int calc_manipulator_stats(ScrArea *sa)
{
extern ListBase editNurb;
View3D *v3d= sa->spacedata.first;
@@ -1318,7 +1318,7 @@ void BIF_draw_manipulator(ScrArea *sa)
if(G.moving==0) {
v3d->twflag &= ~V3D_DRAW_MANIPULATOR;
totsel= calc_manipulator(sa);
totsel= calc_manipulator_stats(sa);
if(totsel==0) return;
v3d->twflag |= V3D_DRAW_MANIPULATOR;