Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | void drawSnapping(const struct bContext *C, TransInfo *t) | ||||
| } | } | ||||
| else if (t->spacetype == SPACE_SEQ) { | else if (t->spacetype == SPACE_SEQ) { | ||||
| if (validSnap(t)) { | if (validSnap(t)) { | ||||
| const ARegion *region = CTX_wm_region(C); | const ARegion *region = CTX_wm_region(C); | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| immBegin(GPU_PRIM_LINES, 2); | UI_GetThemeColor3ubv(TH_SEQ_ACTIVE, col); | ||||
| immVertex2f(pos, t->tsnap.snapPoint[0], region->v2d.cur.ymin); | col[3] = 128; | ||||
| immVertex2f(pos, t->tsnap.snapPoint[0], region->v2d.cur.ymax); | immUniformColor4ubv(col); | ||||
| immEnd(); | float pixelx = BLI_rctf_size_x(®ion->v2d.cur) / BLI_rcti_size_x(®ion->v2d.mask); | ||||
| immRectf(pos, | |||||
| t->tsnap.snapPoint[0] - pixelx, | |||||
| region->v2d.cur.ymax, | |||||
| t->tsnap.snapPoint[0] + pixelx, | |||||
| region->v2d.cur.ymin); | |||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| eRedrawFlag handleSnapping(TransInfo *t, const wmEvent *event) | eRedrawFlag handleSnapping(TransInfo *t, const wmEvent *event) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 1,320 Lines • Show Last 20 Lines | |||||