Fix T100280: GG not toggling the offset transform mode in tracker
Caused by {rB791bfae1d64b}.
The solution was to create the special handle for the Move Clip and Mask
transformation.
One change that cannot be reversed is showing the `G` shortcut in the
statusbar.
But the description of this shortcut was not even correct before.
This commit is contained in:
@@ -1008,13 +1008,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
|
||||
t->redraw |= TREDRAW_HARD;
|
||||
handled = true;
|
||||
}
|
||||
else if (t->options & (CTX_MOVIECLIP | CTX_MASK)) {
|
||||
restoreTransObjects(t);
|
||||
|
||||
t->flag ^= T_ALT_TRANSFORM;
|
||||
t->redraw |= TREDRAW_HARD;
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (t->mode == TFM_TRANSLATION) {
|
||||
|
||||
@@ -287,6 +287,7 @@ void initResize(TransInfo *t, float mouse_dir_constraint[3])
|
||||
{
|
||||
t->mode = TFM_RESIZE;
|
||||
t->transform = applyResize;
|
||||
t->handleEvent = NULL;
|
||||
t->tsnap.applySnap = ApplySnapResize;
|
||||
t->tsnap.distance = ResizeBetween;
|
||||
|
||||
|
||||
@@ -351,6 +351,7 @@ void initRotation(TransInfo *t)
|
||||
|
||||
t->mode = TFM_ROTATION;
|
||||
t->transform = applyRotation;
|
||||
t->handleEvent = NULL;
|
||||
t->transform_matrix = applyRotationMatrix;
|
||||
t->tsnap.applySnap = ApplySnapRotation;
|
||||
t->tsnap.distance = RotationBetween;
|
||||
|
||||
@@ -56,6 +56,8 @@ struct TranslateCustomData {
|
||||
struct {
|
||||
enum eTranslateRotateMode rotate_mode;
|
||||
} prev;
|
||||
|
||||
const wmKeyMapItem *move_kmi;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
@@ -169,6 +171,27 @@ static void transdata_elem_translate_fn(void *__restrict iter_data_v,
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Events to Move Clip and Mask
|
||||
* \{ */
|
||||
|
||||
static eRedrawFlag translate_handleEvent(struct TransInfo *t, const wmEvent *event)
|
||||
{
|
||||
BLI_assert(t->options & (CTX_MOVIECLIP | CTX_MASK));
|
||||
struct TranslateCustomData *custom_data = t->custom.mode.data;
|
||||
const wmKeyMapItem *kmi = custom_data->move_kmi;
|
||||
if (kmi && event->type == kmi->type && event->val == kmi->val) {
|
||||
/* Toggles the handle offset effect. */
|
||||
restoreTransObjects(t);
|
||||
|
||||
t->flag ^= T_ALT_TRANSFORM;
|
||||
return TREDRAW_HARD;
|
||||
}
|
||||
return TREDRAW_NOTHING;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Transform (Translation)
|
||||
* \{ */
|
||||
@@ -620,6 +643,11 @@ void initTranslation(TransInfo *t)
|
||||
custom_data->prev.rotate_mode = TRANSLATE_ROTATE_OFF;
|
||||
t->custom.mode.data = custom_data;
|
||||
t->custom.mode.use_free = true;
|
||||
|
||||
if (t->keymap && (t->options & (CTX_MOVIECLIP | CTX_MASK))) {
|
||||
custom_data->move_kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE);
|
||||
t->handleEvent = translate_handleEvent;
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user