Transform: improve safety when restoring data
This commit is contained in:
parent
3b761901b6
commit
ad01cdd7fc
Notes:
blender-bot
2023-11-13 23:37:21 +01:00
Referenced by commit 9dcf73c715
, Fix #114787: VSE: canceling move does not reset strip channel
|
@ -811,13 +811,15 @@ void applyTransObjects(TransInfo *t)
|
|||
|
||||
static void transdata_restore_basic(TransDataBasic *td_basic)
|
||||
{
|
||||
/* TransData for crease has no loc */
|
||||
if (td_basic->loc) {
|
||||
copy_v3_v3(td_basic->loc, td_basic->iloc);
|
||||
if (td_basic->val) {
|
||||
*td_basic->val = td_basic->ival;
|
||||
}
|
||||
|
||||
if (td_basic->val && td_basic->val != td_basic->loc) {
|
||||
*td_basic->val = td_basic->ival;
|
||||
/* TODO(mano-wii): Only use 3D or larger vectors in `td->loc`.
|
||||
* If `loc` and `val` point to the same address, it may indicate that `loc` is not 3D which is
|
||||
* not safe for `copy_v3_v3`. */
|
||||
if (td_basic->loc && td_basic->val != td_basic->loc) {
|
||||
copy_v3_v3(td_basic->loc, td_basic->iloc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue