forked from bartvdbraak/blender
Bugfix #6078
Transform Properties panel in 3d window: Using TAB on size buttons didn't work well; the code was assuming events with only 1 change per event.
This commit is contained in:
parent
c48a676d47
commit
482d0346fe
@ -1977,10 +1977,12 @@ void do_viewbuts(unsigned short event)
|
||||
|
||||
case B_OBJECTPANELSCALE:
|
||||
if(ob) {
|
||||
|
||||
/* link scale; figure out which axis changed */
|
||||
if (tfp->link_scale) {
|
||||
float ratio, tmp, max = 0.0;
|
||||
int axis;
|
||||
|
||||
/* figure out which axis changed */
|
||||
axis = 0;
|
||||
max = fabs(tfp->ob_scale[0] - ob->size[0]);
|
||||
tmp = fabs(tfp->ob_scale[1] - ob->size[1]);
|
||||
@ -1995,7 +1997,6 @@ void do_viewbuts(unsigned short event)
|
||||
}
|
||||
|
||||
if (ob->size[axis] != tfp->ob_scale[axis]) {
|
||||
if (tfp->link_scale) {
|
||||
if (fabs(ob->size[axis]) > FLT_EPSILON) {
|
||||
ratio = tfp->ob_scale[axis] / ob->size[axis];
|
||||
ob->size[0] *= ratio;
|
||||
@ -2003,12 +2004,14 @@ void do_viewbuts(unsigned short event)
|
||||
ob->size[2] *= ratio;
|
||||
}
|
||||
}
|
||||
ob->size[axis] = tfp->ob_scale[axis];
|
||||
}
|
||||
else {
|
||||
VECCOPY(ob->size, tfp->ob_scale);
|
||||
|
||||
}
|
||||
DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
|
||||
allqueue(REDRAWVIEW3D, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case B_OBJECTPANELDIMS:
|
||||
|
Loading…
Reference in New Issue
Block a user