From 482d0346fe13211379b72cdcc21ec0b9f473fb6a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 9 Apr 2007 10:01:46 +0000 Subject: [PATCH] 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. --- source/blender/src/drawview.c | 47 +++++++++++++++++++---------------- 1 file 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;