Fix forced snap status being removed when changing transform mode

The `SNAP_FORCED` setting is set to the operation and not the snap
status.

Therefore, this option should not be cleared along with the other
statuses when resetting snapping.

Move then the location of this setting to `TransInfo::modifiers`.
This commit is contained in:
2023-02-06 11:04:07 -03:00
parent f2538c7173
commit deaddbdcff
3 changed files with 9 additions and 8 deletions

View File

@@ -147,7 +147,7 @@ bool transformModeUseSnap(const TransInfo *t)
static bool doForceIncrementSnap(const TransInfo *t)
{
if (t->tsnap.status & SNAP_FORCED) {
if (t->modifiers & MOD_SNAP_FORCED) {
return false;
}
@@ -808,7 +808,8 @@ void initSnapping(TransInfo *t, wmOperator *op)
if ((prop = RNA_struct_find_property(op->ptr, "snap_point")) &&
RNA_property_is_set(op->ptr, prop)) {
RNA_property_float_get_array(op->ptr, prop, t->tsnap.snap_target);
t->tsnap.status |= SNAP_FORCED | SNAP_TARGET_FOUND;
t->modifiers |= MOD_SNAP_FORCED;
t->tsnap.status |= SNAP_TARGET_FOUND;
}
/* snap align only defined in specific cases */