Cleanup: remove unnecessary context argument to drawSnapping
This commit is contained in:
parent
2839e23a45
commit
89c2e3c9dc
|
@ -216,4 +216,4 @@ bool ED_transform_snap_sequencer_to_closest_strip_calc(Scene *scene,
|
|||
int *r_snap_distance,
|
||||
float *r_snap_frame);
|
||||
|
||||
void ED_draw_sequencer_snap_point(bContext *C, float snap_point);
|
||||
void ED_draw_sequencer_snap_point(struct ARegion *region, float snap_point);
|
||||
|
|
|
@ -366,7 +366,7 @@ static void draw_seq_in_view(bContext *C, wmWindow * /*win*/, wmDrag *drag, cons
|
|||
UI_SetTheme(SPACE_SEQ, RGN_TYPE_WINDOW);
|
||||
|
||||
if (coords->use_snapping) {
|
||||
ED_draw_sequencer_snap_point(C, coords->snap_point_x);
|
||||
ED_draw_sequencer_snap_point(region, coords->snap_point_x);
|
||||
}
|
||||
|
||||
/* Init GPU drawing. */
|
||||
|
|
|
@ -1487,7 +1487,7 @@ static void drawTransformView(const bContext *C, ARegion *region, void *arg)
|
|||
|
||||
drawConstraint(t);
|
||||
drawPropCircle(C, t);
|
||||
drawSnapping(C, t);
|
||||
drawSnapping(t);
|
||||
|
||||
if (region == t->region && t->mode_info && t->mode_info->draw_fn) {
|
||||
t->mode_info->draw_fn(t);
|
||||
|
|
|
@ -172,7 +172,7 @@ static bool doForceIncrementSnap(const TransInfo *t)
|
|||
return !transformModeUseSnap(t);
|
||||
}
|
||||
|
||||
void drawSnapping(const bContext *C, TransInfo *t)
|
||||
void drawSnapping(TransInfo *t)
|
||||
{
|
||||
uchar col[4], selectedCol[4], activeCol[4];
|
||||
if (!(transform_snap_is_active(t) || t->modifiers & MOD_EDIT_SNAP_SOURCE)) {
|
||||
|
@ -277,7 +277,7 @@ void drawSnapping(const bContext *C, TransInfo *t)
|
|||
GPU_matrix_pop_projection();
|
||||
}
|
||||
else if (t->spacetype == SPACE_NODE) {
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
ARegion *region = t->region;
|
||||
float size;
|
||||
|
||||
size = 2.5f * UI_GetThemeValuef(TH_VERTEX_SIZE);
|
||||
|
@ -311,7 +311,7 @@ void drawSnapping(const bContext *C, TransInfo *t)
|
|||
GPU_blend(GPU_BLEND_NONE);
|
||||
}
|
||||
else if (t->spacetype == SPACE_SEQ) {
|
||||
const ARegion *region = CTX_wm_region(C);
|
||||
const ARegion *region = t->region;
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
|
|
|
@ -55,7 +55,7 @@ void transform_snap_project_individual_apply(TransInfo *t);
|
|||
void transform_snap_mixed_apply(TransInfo *t, float *vec);
|
||||
void resetSnapping(TransInfo *t);
|
||||
eRedrawFlag handleSnapping(TransInfo *t, const wmEvent *event);
|
||||
void drawSnapping(const bContext *C, TransInfo *t);
|
||||
void drawSnapping(TransInfo *t);
|
||||
bool usingSnappingNormal(const TransInfo *t);
|
||||
bool validSnappingNormal(const TransInfo *t);
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ bool ED_transform_snap_sequencer_to_closest_strip_calc(Scene *scene,
|
|||
return validSnap(&t);
|
||||
}
|
||||
|
||||
void ED_draw_sequencer_snap_point(bContext *C, float snap_point)
|
||||
void ED_draw_sequencer_snap_point(ARegion *region, const float snap_point)
|
||||
{
|
||||
/* Reuse the snapping drawing code from the transform system. */
|
||||
TransInfo t = {nullptr};
|
||||
|
@ -400,6 +400,7 @@ void ED_draw_sequencer_snap_point(bContext *C, float snap_point)
|
|||
t.tsnap.flag = SCE_SNAP;
|
||||
t.tsnap.status = (SNAP_TARGET_FOUND | SNAP_SOURCE_FOUND);
|
||||
t.tsnap.snap_target[0] = snap_point;
|
||||
t.region = region;
|
||||
|
||||
drawSnapping(C, &t);
|
||||
drawSnapping(&t);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue