From d493fc43bd4aac7f2e0e448957f3ab1412d9691d Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Tue, 14 Jul 2020 17:45:31 -0300 Subject: Fix T78875: Numerical display of delta of translation is not updating in 3d view --- .../editors/transform/transform_mode_translate.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/transform/transform_mode_translate.c') diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index aee05197f10..cde06a9eaac 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -67,15 +67,27 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ dist = len_v3(t->num.val); } else { + int i = 0; float dvec[3]; - - copy_v3_v3(dvec, vec); - applyAspectRatio(t, dvec); + if (!(t->flag & T_2D_EDIT) && t->con.mode & CON_APPLY) { + zero_v3(dvec); + if (t->con.mode & CON_AXIS0) { + dvec[i++] = vec[0]; + } + if (t->con.mode & CON_AXIS1) { + dvec[i++] = vec[1]; + } + if (t->con.mode & CON_AXIS2) { + dvec[i++] = vec[2]; + } + } + else { + copy_v3_v3(dvec, vec); + applyAspectRatio(t, dvec); + } dist = len_v3(vec); if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) { - int i; - for (i = 0; i < 3; i++) { bUnit_AsString2(&tvec[NUM_STR_REP_LEN * i], NUM_STR_REP_LEN, -- cgit v1.2.3