Transform: Show Snap Base when adding multiple snap points

This is part of what was implemented in #109062

When adding multiple snap points (`A` key), the 'Snap Base' location no longer corresponds to the snap target point, so it becomes invisible.

Therefore, show the resulting `Snap Base` during this operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/109379
This commit is contained in:
Germano Cavalcante
2023-06-26 17:41:15 +02:00
committed by Germano Cavalcante
parent dac8ef53a3
commit 9b1e56f013
2 changed files with 5 additions and 2 deletions

View File

@@ -75,7 +75,6 @@ static void snapsource_confirm(TransInfo *t)
getSnapPoint(t, t->tsnap.snap_source);
t->tsnap.snap_source_fn = NULL;
t->tsnap.status |= SNAP_SOURCE_FOUND;
t->flag |= T_DRAW_SNAP_SOURCE;
struct SnapSouceCustomData *customdata = t->custom.mode.data;
t->tsnap.mode = customdata->snap_mode_confirm;
@@ -152,6 +151,9 @@ static void snapsource_transform_fn(TransInfo *t, const int UNUSED(mval[2]))
BLI_assert(t->modifiers & MOD_EDIT_SNAP_SOURCE);
t->tsnap.snap_target_fn(t, NULL);
if (t->tsnap.status & SNAP_MULTI_POINTS) {
getSnapPoint(t, t->tsnap.snap_source);
}
t->redraw |= TREDRAW_SOFT;
}
@@ -184,6 +186,7 @@ void transform_mode_snap_source_init(TransInfo *t, wmOperator *UNUSED(op))
}
t->mode_info = &TransMode_snapsource;
t->flag |= T_DRAW_SNAP_SOURCE;
t->tsnap.target_operation = SCE_SNAP_TARGET_ALL;
t->tsnap.status &= ~SNAP_SOURCE_FOUND;

View File

@@ -174,7 +174,7 @@ void drawSnapping(const bContext *C, TransInfo *t)
return;
}
const bool draw_source = (t->tsnap.status & SNAP_SOURCE_FOUND) && (t->flag & T_DRAW_SNAP_SOURCE);
const bool draw_source = (t->flag & T_DRAW_SNAP_SOURCE) && (t->tsnap.status & (SNAP_SOURCE_FOUND | SNAP_MULTI_POINTS));
const bool draw_target = (t->tsnap.status & (SNAP_TARGET_FOUND | SNAP_MULTI_POINTS));
if (!(draw_source || draw_target)) {