diff options
author | Ton Roosendaal <ton@blender.org> | 2007-04-09 14:01:46 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-04-09 14:01:46 +0400 |
commit | 482d0346fe13211379b72cdcc21ec0b9f473fb6a (patch) | |
tree | a530e8a3451ddf39401dfa993ea8f52016bd0420 /source | |
parent | c48a676d471ca6d389c25c1bc21254022bcf2191 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/drawview.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index bdb56c091f5..3c7fa96e608 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -1977,25 +1977,26 @@ void do_viewbuts(unsigned short event) case B_OBJECTPANELSCALE: if(ob) { - 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]); - if (tmp > max) { - axis = 1; - max = tmp; - } - tmp = fabs(tfp->ob_scale[2] - ob->size[2]); - if (tmp > max) { - axis = 2; - max = tmp; - } - - if (ob->size[axis] != tfp->ob_scale[axis]) { - if (tfp->link_scale) { + /* link scale; figure out which axis changed */ + if (tfp->link_scale) { + float ratio, tmp, max = 0.0; + int axis; + + axis = 0; + max = fabs(tfp->ob_scale[0] - ob->size[0]); + tmp = fabs(tfp->ob_scale[1] - ob->size[1]); + if (tmp > max) { + axis = 1; + max = tmp; + } + tmp = fabs(tfp->ob_scale[2] - ob->size[2]); + if (tmp > max) { + axis = 2; + max = tmp; + } + + if (ob->size[axis] != tfp->ob_scale[axis]) { if (fabs(ob->size[axis]) > FLT_EPSILON) { ratio = tfp->ob_scale[axis] / ob->size[axis]; ob->size[0] *= ratio; @@ -2003,11 +2004,13 @@ void do_viewbuts(unsigned short event) ob->size[2] *= ratio; } } - ob->size[axis] = tfp->ob_scale[axis]; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 1); } + else { + VECCOPY(ob->size, tfp->ob_scale); + + } + DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); + allqueue(REDRAWVIEW3D, 1); } break; |