diff options
author | Germano Cavalcante <mano-wii> | 2021-12-21 18:55:36 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-12-21 19:00:51 +0300 |
commit | 6db09197242c49ce36949c48bfe2bb7280f85e1a (patch) | |
tree | 73796b3a9a89f91bacbebd84ceb26c8b64ec6c98 /source/blender/editors/transform/transform_mode_translate.c | |
parent | aa7105f7599f8d35438444006eb1e43f211286dd (diff) |
Fix T94191: correct (time) translation headers not showing DeltaX
Caused by {rBb0d9e6797fb8}
For the header (both Graph Editor case in general `headerTranslation` as
well as `headerTimeTranslate`) we are interested in deltas values
(not absolute values).
Since culprit commit, `snapFrameTransform` was not working with deltas
anymore, but we have to compensate for this.
For the Graph Editor, this only worked "by accident" in rB7192e57d63a5,
since `ival` is still zero at this point.
So now, reacquire the delta right after the snap operation.
Also use a more appropriate center value in the translate operator.
Maniphest Tasks: T94191
Differential Revision: https://developer.blender.org/D13641
Diffstat (limited to 'source/blender/editors/transform/transform_mode_translate.c')
-rw-r--r-- | source/blender/editors/transform/transform_mode_translate.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index 19d0c6d39a3..b8b043c650f 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -225,11 +225,12 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ if (t->spacetype == SPACE_GRAPH) { /* WORKAROUND: * Special case where snapping is done in #recalData. - * Update the header based on the first element. */ + * Update the header based on the #center_local. */ const short autosnap = getAnimEdit_SnapMode(t); - float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->data->ival; + float ival = TRANS_DATA_CONTAINER_FIRST_OK(t)->center_local[0]; float val = ival + dvec[0]; - snapFrameTransform(t, autosnap, ival, val, &dvec[0]); + snapFrameTransform(t, autosnap, ival, val, &val); + dvec[0] = val - ival; } if (t->con.mode & CON_APPLY) { |