Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-07-01 23:08:11 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-07-01 23:08:11 +0300
commit519c12da4162a42ed0ce2e41db45be21632ab446 (patch)
treeda235d413d732a020f7d6f06d22c5278c66e1fdc /source/blender/editors/transform
parent4a7951fede101264efa1c085c66b84d47096ca50 (diff)
VSE: Snapping feedback
Address initial feedback: - Use checkboxes instead of radio buttons - Hide snapping distance control from UI - Tweak snapping line color - use selected strip color, 50% transparency. Similar to other editors - Draw 2px thick line, since strip outline is also 2px thick Reviewed By: HooglyBoogly Differential Revision: https://developer.blender.org/D11759
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_snap.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 9a33dc1218d..05dcc612aae 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -303,10 +303,15 @@ void drawSnapping(const struct bContext *C, TransInfo *t)
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immBegin(GPU_PRIM_LINES, 2);
- immVertex2f(pos, t->tsnap.snapPoint[0], region->v2d.cur.ymin);
- immVertex2f(pos, t->tsnap.snapPoint[0], region->v2d.cur.ymax);
- immEnd();
+ UI_GetThemeColor3ubv(TH_SEQ_ACTIVE, col);
+ col[3] = 128;
+ immUniformColor4ubv(col);
+ float pixelx = BLI_rctf_size_x(&region->v2d.cur) / BLI_rcti_size_x(&region->v2d.mask);
+ immRectf(pos,
+ t->tsnap.snapPoint[0] - pixelx,
+ region->v2d.cur.ymax,
+ t->tsnap.snapPoint[0] + pixelx,
+ region->v2d.cur.ymin);
immUnbindProgram();
GPU_blend(GPU_BLEND_NONE);
}