Fix regression with incremental snap in Graph Editor

Regression introduced in {rBb0d9e6797fb8}.

Previously the Graphics Editor had a conflict with two different snap
types. Auto-Snap and Snap with Ctrl.

It is now clearer which snap should prevail.
This commit is contained in:
Germano Cavalcante 2021-10-14 13:03:26 -03:00
parent b42ce0c54c
commit 5e12e62a6a
Notes: blender-bot 2023-02-13 11:52:57 +01:00
Referenced by commit 497d0400bd, Fix another error in rB5e12e62a6a4e
Referenced by commit 328b6f672b, Fix error in rB5e12e62a6a4e
2 changed files with 9 additions and 4 deletions

View File

@ -615,7 +615,7 @@ static void initSnappingMode(TransInfo *t)
t->tsnap.mode |= SCE_SNAP_MODE_GRID;
}
}
else if (ELEM(t->spacetype, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) {
else if (ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA)) {
/* No incremental snapping. */
t->tsnap.mode = 0;
}

View File

@ -56,10 +56,15 @@ short getAnimEdit_SnapMode(TransInfo *t)
}
}
else if (t->spacetype == SPACE_GRAPH) {
SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first;
if ((t->data_type == TFM_TRANSLATION) && activeSnap(t)) {
/* Use the translate mode snap. */
}
else {
SpaceGraph *sipo = (SpaceGraph *)t->area->spacedata.first;
if (sipo) {
autosnap = sipo->autosnap;
if (sipo) {
autosnap = sipo->autosnap;
}
}
}
else if (t->spacetype == SPACE_NLA) {